Files
router-dash/flake.nix
Joakim Repomaa ea315d3a52
All checks were successful
Nix Build / build (push) Successful in 1m12s
allow overriding api url
2026-02-22 23:16:59 +02:00

67 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=";
API_URL = "/api";
buildPhase = ''
runHook preBuild
PUBLIC_API_URL="''${API_URL}" 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.agpl3Only;
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"
'';
};
}
);
}