forked from mirrors_public/oddlama_nix-config
feat: finish new container backend
This commit is contained in:
parent
9833fd50ce
commit
32ce7fe25d
4 changed files with 15 additions and 7 deletions
|
@ -67,7 +67,7 @@
|
||||||
modules = [
|
modules = [
|
||||||
../../modules
|
../../modules
|
||||||
./guests/common.nix
|
./guests/common.nix
|
||||||
({config, ...}: {node.secretsDir = ./secrets + "/${config.node.name}";})
|
({config, ...}: {node.secretsDir = ./secrets + "/${config.node.guestName}";})
|
||||||
mainModule
|
mainModule
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,6 +56,6 @@
|
||||||
# TODO See https://github.com/ryantm/agenix/pull/187.
|
# TODO See https://github.com/ryantm/agenix/pull/187.
|
||||||
system.activationScripts = lib.mkIf (config.age.secrets != {}) {
|
system.activationScripts = lib.mkIf (config.age.secrets != {}) {
|
||||||
removeAgenixLink.text = "[[ ! -L /run/agenix ]] && [[ -d /run/agenix ]] && rm -rf /run/agenix";
|
removeAgenixLink.text = "[[ ! -L /run/agenix ]] && [[ -d /run/agenix ]] && rm -rf /run/agenix";
|
||||||
activationScripts.agenixNewGeneration.deps = ["removeAgenixLink"];
|
agenixNewGeneration.deps = ["removeAgenixLink"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
_guestName: guestCfg: {lib, ...}: let
|
guestName: guestCfg: {lib, ...}: let
|
||||||
inherit (lib) mkForce;
|
inherit (lib) mkForce;
|
||||||
in {
|
in {
|
||||||
|
node.guestName = guestName;
|
||||||
node.name = guestCfg.nodeName;
|
node.name = guestCfg.nodeName;
|
||||||
node.type = guestCfg.backend;
|
node.type = guestCfg.backend;
|
||||||
|
|
||||||
|
|
|
@ -97,10 +97,17 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
options.node.type = mkOption {
|
options.node = {
|
||||||
type = types.enum ["host" "microvm" "container"];
|
type = mkOption {
|
||||||
description = "The type of this machine.";
|
type = types.enum ["host" "microvm" "container"];
|
||||||
default = "host";
|
description = "The type of this machine.";
|
||||||
|
default = "host";
|
||||||
|
};
|
||||||
|
|
||||||
|
guestName = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "The base name of this machine without the parent's name. Only defined if this is a guest.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
options.containers = mkOption {
|
options.containers = mkOption {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue