DRY out systems boilerplate

This commit is contained in:
Tristan D. 2024-06-20 20:48:13 +02:00
parent 2181def3c3
commit 70a1511c6f
Signed by: tristan
SSH key fingerprint: SHA256:WtyH40TFEIklkqijla5j9zqbuMV3mE/vC9DA/xVbJZA

View file

@ -133,13 +133,21 @@
nixos-pulse = import ./systems/nixos-pulse/disko.nix; nixos-pulse = import ./systems/nixos-pulse/disko.nix;
nixos-he4 = import ./systems/nixos-he4/disko.nix; nixos-he4 = import ./systems/nixos-he4/disko.nix;
}; };
nixosConfigurations = { nixosConfigurations = nixpkgs.lib.attrsets.mergeAttrsList (
nixos-he4 = nixpkgs.lib.nixosSystem { nixpkgs.lib.lists.forEach [
"nixos-desk"
"nixos-he4"
"nixos-karl-kvm-guest"
"nixos-pulse"
"nixos-fw16"
]
(host: {
"${host}" = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = args; specialArgs = args;
modules = modules =
[ [
./systems/nixos-he4 ./systems/${host}
{ {
nixpkgs.pkgs = pkgs; nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
@ -149,69 +157,17 @@
] ]
++ osModules; ++ osModules;
}; };
nixos-pulse = nixpkgs.lib.nixosSystem { })
inherit system; );
specialArgs = args; # {
modules = # _module.args.nixinate = {
[ # host = "100.64.0.3";
./systems/nixos-pulse # sshUser = "tristand";
{ # buildOn = "remote"; # valid args are "local" or "remote"
nixpkgs.pkgs = pkgs; # substituteOnTarget = false; # if buildOn is "local" then it will substitute on the target, "-s"
nix.registry.nixpkgs.flake = nixpkgs; # hermetic = false;
home-manager.sharedModules = hmModules; # };
home-manager.extraSpecialArgs = args; # }
} # };
]
++ osModules;
};
nixos-desk = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/nixos-desk
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
{
_module.args.nixinate = {
host = "100.64.0.3";
sshUser = "tristand";
buildOn = "remote"; # valid args are "local" or "remote"
substituteOnTarget = false; # if buildOn is "local" then it will substitute on the target, "-s"
hermetic = false;
};
}
]
++ osModules;
};
nixos-karl-kvm-guest = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/nixos-karl-kvm-guest
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
{
_module.args.nixinate = {
host = "nixos-karl-kvm-guest.oekonzept.de";
sshUser = "reopen5194";
buildOn = "remote"; # valid args are "local" or "remote"
substituteOnTarget = false; # if buildOn is "local" then it will substitute on the target, "-s"
hermetic = false;
};
}
]
++ osModules;
};
};
}; };
} }