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

116
flake.nix
View file

@ -133,85 +133,41 @@
nixos-pulse = import ./systems/nixos-pulse/disko.nix;
nixos-he4 = import ./systems/nixos-he4/disko.nix;
};
nixosConfigurations = {
nixos-he4 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/nixos-he4
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
]
++ osModules;
};
nixos-pulse = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/nixos-pulse
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
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;
};
};
nixosConfigurations = nixpkgs.lib.attrsets.mergeAttrsList (
nixpkgs.lib.lists.forEach [
"nixos-desk"
"nixos-he4"
"nixos-karl-kvm-guest"
"nixos-pulse"
"nixos-fw16"
]
(host: {
"${host}" = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/${host}
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
]
++ osModules;
};
})
);
# {
# _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;
# };
# }
# };
};
}