pinchflat vpn, testbed random, virt-manager
This commit is contained in:
parent
d2eaec6860
commit
db6d5161ff
13 changed files with 1645 additions and 64 deletions
|
@ -15,6 +15,7 @@ in
|
|||
./incus.nix
|
||||
./flatpaks.nix
|
||||
./opencode.nix
|
||||
./virt-manager.nix
|
||||
];
|
||||
config = {
|
||||
assertions = [
|
||||
|
|
42
common/programs/virt-manager.nix
Normal file
42
common/programs/virt-manager.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ccfg = import ../config.nix;
|
||||
cfg_path = [
|
||||
ccfg.custom_config_key
|
||||
"programs"
|
||||
"virt-manager"
|
||||
];
|
||||
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 "Enable virt manager/quemu";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = builtins.attrNames users_cfg;
|
||||
description = "Users to configure for virt-manager.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.qemuGuest.enable = true;
|
||||
services.spice-vdagentd.enable = true;
|
||||
programs.virt-manager = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
libvirtd.enable = true;
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
|
||||
users.groups.libvirtd.members = cfg.users;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue