alqueva/lib/default.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

{
inputs,
self,
}: _: _: let
2024-11-30 15:18:36 +00:00
mkHost = {
2024-10-16 00:03:53 +01:00
host,
system,
extraModules ? [],
}:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules =
extraModules
++ [
2024-11-30 15:18:36 +00:00
../hosts/${host}
2024-10-16 08:55:04 +01:00
inputs.self.nixosModules.default
2024-10-16 00:03:53 +01:00
({config, ...}: {
config = {
nix = {
settings.extra-experimental-features = [
"nix-command"
"flakes"
];
gc = {
automatic = true;
dates = "weekly";
};
};
2024-11-26 13:51:16 +00:00
nixpkgs.config.allowUnfree = true;
2024-10-16 00:03:53 +01:00
environment.shellAliases = {
rebs = "nixos-rebuild --use-remote-sudo switch --flake .#${host}";
rebt = "nixos-rebuild --use-remote-sudo test --flake .#${host}";
};
2024-10-16 17:01:46 +01:00
nixpkgs.overlays = [
inputs.self.overlays.default
];
2024-10-16 00:03:53 +01:00
networking.hostName = host;
};
})
];
specialArgs = {
inherit inputs self;
2024-10-16 00:03:53 +01:00
};
};
in {
2024-11-30 15:18:36 +00:00
mkHosts = builtins.mapAttrs (n: v: mkHost (v // {host = n;}));
2024-10-16 00:03:53 +01:00
}