39 lines
1.7 KiB
Nix
39 lines
1.7 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
|
headscale.url = "github:juanfont/headscale";
|
|
headplane = {
|
|
url = "github:tale/headplane";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
outputs = { self, nixpkgs, headscale, headplane, ... }@inputs: {
|
|
nixosConfigurations.headscale = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./configuration.nix
|
|
./hardware-configuration.nix
|
|
./headscale.nix
|
|
headplane.nixosModules.headplane
|
|
({ pkgs, ... }: {
|
|
nixpkgs.overlays = [
|
|
headplane.overlays.default
|
|
(final: prev: {
|
|
headplane = prev.headplane.overrideAttrs (oldAttrs: {
|
|
postInstall = (oldAttrs.postInstall or "") + ''
|
|
# Patch server-build.js to handle missing availableRoutes/approvedRoutes in Headscale v0.25+ API
|
|
find $out/share/headplane/build/server/assets -name "server-build.js" -exec sed -i 's/node.availableRoutes.filter/(node.availableRoutes || []).filter/g' {} +
|
|
find $out/share/headplane/build/server/assets -name "server-build.js" -exec sed -i 's/node.approvedRoutes.some/(node.approvedRoutes || []).some/g' {} +
|
|
find $out/share/headplane/build/server/assets -name "server-build.js" -exec sed -i 's/node.approvedRoutes.filter/(node.approvedRoutes || []).filter/g' {} +
|
|
find $out/share/headplane/build/server/assets -name "server-build.js" -exec sed -i 's/node.availableRoutes.includes/(node.availableRoutes || []).includes/g' {} +
|
|
'';
|
|
});
|
|
})
|
|
];
|
|
})
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
};
|
|
}
|