flake.nix: specify modules and extra config per nixos config

This commit is contained in:
Oystein Kristoffer Tveit 2024-06-29 13:48:06 +02:00
parent 34f127c9a1
commit 6a2057f531
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 63 additions and 54 deletions

View File

@ -162,38 +162,31 @@
};
nixosConfigurations = let
nixSys = name:
nixpkgs.lib.nixosSystem {
nixSys = name: extraConfig:
nixpkgs.lib.nixosSystem
({
inherit system;
inherit pkgs;
inherit (pkgs) lib;
modules = [
"${home-manager}/nixos"
./modules/machineVars.nix
./modules/socketActivation.nix
./hosts/common
./hosts/${name}/configuration.nix
matrix-synapse-next.nixosModules.default
osuchan.outputs.nixosModules.default
secrets.outputs.nixos-config
sops-nix.nixosModules.sops
vscode-server.nixosModules.default
maunium-stickerpicker.nixosModules.default
(args: import minecraft.outputs.nixosModules.minecraft-servers (args // {
pkgs = unstable-pkgs;
lib = unstable-pkgs.lib;
}))
{
config._module.args = {
specialArgs = {
inherit inputs;
inherit unstable-pkgs;
inherit (self) extendedLib;
secrets = secrets.outputs.settings;
};
}
} // (extraConfig.specialArgs or { });
modules = [
"${home-manager}/nixos"
./hosts/common
./hosts/${name}/configuration.nix
./modules/machineVars.nix
./modules/socketActivation.nix
secrets.outputs.nixos-config
sops-nix.nixosModules.sops
({ config, ... }:
{
@ -211,17 +204,33 @@
inputs.sops-nix.homeManagerModules.sops
];
users.h7x4 = {
imports = [ ./home/home.nix ];
};
users.h7x4.imports = [ ./home/home.nix ];
};
})
] ++ (extraConfig.modules or [ ]);
}
//
(builtins.removeAttrs extraConfig [
"modules"
"specialArgs"
]));
in {
dosei = nixSys "dosei" { };
kasei = nixSys "kasei" { };
tsuki = nixSys "tsuki" {
modules = [
matrix-synapse-next.nixosModules.default
osuchan.outputs.nixosModules.default
sops-nix.nixosModules.sops
vscode-server.nixosModules.default
maunium-stickerpicker.nixosModules.default
(args: import minecraft.outputs.nixosModules.minecraft-servers (args // {
pkgs = unstable-pkgs;
lib = unstable-pkgs.lib;
}))
];
};
in {
tsuki = nixSys "tsuki";
kasei = nixSys "kasei";
dosei = nixSys "dosei";
};
};
}