add boot vars, and pass name arg
This commit is contained in:
parent
6447202f7f
commit
b153246f90
7 changed files with 279 additions and 21 deletions
21
flake.nix
21
flake.nix
|
@ -20,19 +20,22 @@
|
|||
deployPkgs-25-05 = import nixpkgs-25-05 {
|
||||
inherit system;
|
||||
overlays = [
|
||||
deploy-rs.overlay.default
|
||||
deploy-rs.overlays.default
|
||||
(self: super: { deploy-rs = { inherit (pkgs-25-05) deploy-rs; lib = super.deploy-rs.lib; }; })
|
||||
];
|
||||
};
|
||||
deployPkgs-unstable = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
overlays = [
|
||||
deploy-rs.overlay.default
|
||||
deploy-rs.overlays.default
|
||||
(self: super: { deploy-rs = { inherit (pkgs-unstable) deploy-rs; lib = super.deploy-rs.lib; }; })
|
||||
];
|
||||
};
|
||||
|
||||
nodes = import ./shared/nodes.nix;
|
||||
getDeployPkgs = ver: if ver == "25-05" then deployPkgs-25-05 else deployPkgs-unstable;
|
||||
getNixpkgs = ver: if ver == "25-05" then nixpkgs-25-05 else nixpkgs-unstable;
|
||||
|
||||
nodes = import ./nodes.nix;
|
||||
|
||||
defaultModules = [
|
||||
./shared/users.nix
|
||||
|
@ -40,6 +43,13 @@
|
|||
];
|
||||
|
||||
in {
|
||||
nixosConfigurations = builtins.mapAttrs (name: config:
|
||||
(getNixpkgs config.ver).lib.nixosSystem {
|
||||
system = config.system;
|
||||
modules = config.modules ++ defaultModules ++ [{ hostName = ${name}; }];
|
||||
}
|
||||
) nodes;
|
||||
|
||||
deploy = {
|
||||
user = "root";
|
||||
autoRollback = true;
|
||||
|
@ -51,10 +61,7 @@
|
|||
profilesOrder = [ "system" ];
|
||||
profiles = {
|
||||
system = {
|
||||
path = "deployPkgs-${config.ver}".deploy-rs.lib.activate.nixos "nixpkgs-${config.ver}".lib.nixosSystem {
|
||||
system = config.system;
|
||||
modules = config.modules ++ defaultModules;
|
||||
};
|
||||
path = (getDeployPkgs config.ver).deploy-rs.lib.activate.nixos self.nixosConfigurations.${name};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue