alqueva/lib/default.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

{
inputs,
self,
...
}: {
flake.lib = inputs.nixpkgs.lib.extend (_: _: {
mkHost = {
host,
system,
extraModules ? [],
}:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules =
extraModules
++ [
../hosts/${host}
inputs.self.nixosModules.default
({config, ...}: {
config = {
nix = {
settings.extra-experimental-features = [
"nix-command"
"flakes"
];
gc = {
automatic = true;
dates = "weekly";
};
2024-10-16 00:03:53 +01:00
};
nixpkgs.config.allowUnfree = true;
environment.shellAliases = {
rebs = "nixos-rebuild --use-remote-sudo switch --flake .#${host}";
rebt = "nixos-rebuild --use-remote-sudo test --flake .#${host}";
};
nixpkgs.overlays = [
inputs.self.overlays.default
];
networking.hostName = host;
2024-10-16 00:03:53 +01:00
};
})
];
specialArgs = {
inherit inputs self;
};
2024-10-16 00:03:53 +01:00
};
});
2024-10-16 00:03:53 +01:00
}