This commit is contained in:
Oliver Davies 2025-11-19 18:00:00 +00:00
parent d8579a38c5
commit 06e45eeea4

View file

@ -17,7 +17,7 @@
username = "opdavies"; username = "opdavies";
}; };
mkNixosConfiguration = mkHost =
{ {
hostname, hostname,
modules ? [ ], modules ? [ ],
@ -27,8 +27,17 @@
inputs.nixpkgs.lib.nixosSystem { inputs.nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = modules ++ [ 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" "${self}/hosts/${hostname}/configuration.nix"
else
[ ]
)
++ [
(config.flake.modules.nixos."nixosConfigurations/${hostname}" or { })
]; ];
specialArgs = specialArgs // { specialArgs = specialArgs // {
@ -38,17 +47,13 @@
in in
{ {
nixosConfigurations = { nixosConfigurations = {
nixedo = mkNixosConfiguration rec { nixedo = mkHost {
hostname = "nixedo"; hostname = "nixedo";
stateVersion = "24.11"; stateVersion = "24.11";
modules = [ config.flake.modules.nixos."nixosConfigurations/${hostname}" ];
}; };
t480 = mkNixosConfiguration rec { t480 = mkHost {
hostname = "t480"; hostname = "t480";
modules = [ config.flake.modules.nixos."nixosConfigurations/${hostname}" ];
}; };
}; };
}; };