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-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 [
inherit system; "nixos-desk"
specialArgs = args; "nixos-he4"
modules = "nixos-karl-kvm-guest"
[ "nixos-pulse"
./systems/nixos-he4 "nixos-fw16"
{ ]
nixpkgs.pkgs = pkgs; (host: {
nix.registry.nixpkgs.flake = nixpkgs; "${host}" = nixpkgs.lib.nixosSystem {
home-manager.sharedModules = hmModules; inherit system;
home-manager.extraSpecialArgs = args; specialArgs = args;
} modules =
] [
++ osModules; ./systems/${host}
}; {
nixos-pulse = nixpkgs.lib.nixosSystem { nixpkgs.pkgs = pkgs;
inherit system; nix.registry.nixpkgs.flake = nixpkgs;
specialArgs = args; home-manager.sharedModules = hmModules;
modules = home-manager.extraSpecialArgs = args;
[ }
./systems/nixos-pulse ]
{ ++ osModules;
nixpkgs.pkgs = pkgs; };
nix.registry.nixpkgs.flake = nixpkgs; })
home-manager.sharedModules = hmModules; );
home-manager.extraSpecialArgs = args; # {
} # _module.args.nixinate = {
] # host = "100.64.0.3";
++ osModules; # sshUser = "tristand";
}; # buildOn = "remote"; # valid args are "local" or "remote"
nixos-desk = nixpkgs.lib.nixosSystem { # substituteOnTarget = false; # if buildOn is "local" then it will substitute on the target, "-s"
inherit system; # hermetic = false;
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;
};
};
}; };
} }