Files
router-dash/flake.nix
2026-02-22 22:23:49 +02:00

65 lines
1.5 KiB
Nix

{
description = "Router Dashboard - SvelteKit static site";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.buildNpmPackage {
pname = "router-dash";
version = "0.0.1";
src = ./.;
npmDepsHash = "sha256-2XxcsvKeYp+SVBx6Z2uB/34qUr7AderMxXKjm/kS8F0=";
buildPhase = ''
runHook preBuild
npm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/router-dash
cp -r build/* $out/share/router-dash/
runHook postInstall
'';
meta = with pkgs.lib; {
description = "Router Dashboard - A SvelteKit static web interface";
license = licenses.mit;
platforms = platforms.all;
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
nodejs
];
shellHook = ''
echo "Router Dash development environment"
echo " npm run dev - Start development server"
echo " npm run build - Build static site"
'';
};
}
);
}