Refactor
This commit is contained in:
parent
d8579a38c5
commit
06e45eeea4
1 changed files with 15 additions and 10 deletions
|
|
@ -17,7 +17,7 @@
|
||||||
username = "opdavies";
|
username = "opdavies";
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixosConfiguration =
|
mkHost =
|
||||||
{
|
{
|
||||||
hostname,
|
hostname,
|
||||||
modules ? [ ],
|
modules ? [ ],
|
||||||
|
|
@ -27,9 +27,18 @@
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
modules = modules ++ [
|
modules =
|
||||||
"${self}/hosts/${hostname}/configuration.nix"
|
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 // {
|
specialArgs = specialArgs // {
|
||||||
inherit hostname stateVersion system;
|
inherit hostname stateVersion system;
|
||||||
|
|
@ -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}" ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue