add incus
This commit is contained in:
parent
0a44506872
commit
a465aee384
2 changed files with 34 additions and 0 deletions
|
@ -7,5 +7,6 @@
|
|||
./tailnet.nix
|
||||
./ssh.nix
|
||||
./docker.nix
|
||||
./incus.nix
|
||||
];
|
||||
}
|
||||
|
|
33
common/programs/incus.nix
Normal file
33
common/programs/incus.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ccfg = import ../config.nix;
|
||||
cfg_path = [
|
||||
ccfg.custom_config_key
|
||||
"programs"
|
||||
"incus"
|
||||
];
|
||||
cfg = lib.attrsets.getAttrFromPath cfg_path config;
|
||||
users_cfg = config.${ccfg.custom_config_key}.users;
|
||||
in
|
||||
{
|
||||
options =
|
||||
{ }
|
||||
// lib.attrsets.setAttrByPath cfg_path {
|
||||
enable = lib.mkEnableOption "incus";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.incus = {
|
||||
enable = true;
|
||||
agent.enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
|
||||
users.extraGroups.incus_admin.members = lib.mkIf (users_cfg.primary != null) [ users_cfg.primary ];
|
||||
users.extraGroups.incus.members = lib.mkIf (users_cfg.primary != null) [ users_cfg.primary ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue