nix-config/modules/nixos-configurations.nix
Oliver Davies 17be52b377
Some checks are pending
/ check (push) Waiting to run
Move ponthirtaekwondo.co.uk
2025-11-19 22:56:31 +00:00

65 lines
1.3 KiB
Nix

{
config,
inputs,
self,
...
}:
{
flake =
let
inherit (self) outputs;
specialArgs = {
inherit inputs outputs self;
system = "x86_64-linux";
username = "opdavies";
};
mkHost =
{
hostname,
modules ? [ ],
stateVersion ? "22.11",
system ? "x86_64-linux",
}:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules =
modules
++ (
# TODO: remove once everything has bee moved to modules.
if builtins.pathExists "${self}/hosts/${hostname}/configuration.nix" then
[ "${self}/hosts/${hostname}/configuration.nix" ]
else
[ ]
)
++ [
(config.flake.modules.nixos."nixosConfigurations/${hostname}" or { })
];
specialArgs = specialArgs // {
inherit hostname stateVersion system;
};
};
in
{
nixosConfigurations = {
home02 = mkHost {
hostname = "home02";
stateVersion = "25.05";
};
nixedo = mkHost {
hostname = "nixedo";
stateVersion = "24.11";
};
t480 = mkHost {
hostname = "t480";
};
};
};
}