Extract mkNixosConfiguration
helper
This commit is contained in:
parent
c134aaeb1b
commit
f02ace1040
1 changed files with 23 additions and 51 deletions
74
flake.nix
74
flake.nix
|
@ -44,65 +44,37 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
username = "opdavies";
|
username = "opdavies";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkNixosConfiguration =
|
||||||
|
{
|
||||||
|
hostname,
|
||||||
|
stateVersion ? "22.11",
|
||||||
|
system ? "x86_64-linux",
|
||||||
|
}:
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
|
||||||
|
modules = [ ./hosts/${hostname}/configuration.nix ];
|
||||||
|
|
||||||
|
specialArgs = specialArgs // {
|
||||||
|
inherit hostname stateVersion system;
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeManagerModules.default = import ./modules/home-manager;
|
homeManagerModules.default = import ./modules/home-manager;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
lemp11 = nixpkgs.lib.nixosSystem {
|
lemp11 = mkNixosConfiguration { hostname = "lemp11"; };
|
||||||
modules = [
|
|
||||||
./hosts/lemp11/configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
nixedo = mkNixosConfiguration {
|
||||||
hostname = "lemp11";
|
hostname = "nixedo";
|
||||||
stateVersion = "22.11";
|
stateVersion = "24.11";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixedo = nixpkgs.lib.nixosSystem {
|
t480 = mkNixosConfiguration { hostname = "t480"; };
|
||||||
modules = [
|
t490 = mkNixosConfiguration { hostname = "t490"; };
|
||||||
./hosts/nixedo/configuration.nix
|
PW05CH3L = mkNixosConfiguration { hostname = "PW05CH3L"; };
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
|
||||||
hostname = "nixedo";
|
|
||||||
stateVersion = "24.11";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
t480 = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
./hosts/t480/configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
|
||||||
hostname = "t480";
|
|
||||||
stateVersion = "22.11";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
t490 = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
./hosts/t490/configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
|
||||||
hostname = "t490";
|
|
||||||
stateVersion = "22.11";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
PW05CH3L = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
./hosts/PW05CH3L/configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
|
||||||
hostname = "PW05CH3L";
|
|
||||||
stateVersion = "22.11";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.default = import ./modules/nixos;
|
nixosModules.default = import ./modules/nixos;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue