add graphical.virt module
This commit is contained in:
parent
7bc3d6b501
commit
f7ad07daf8
2 changed files with 34 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ in
|
|||
./games
|
||||
./jp.nix
|
||||
./mpv.nix
|
||||
./virt.nix
|
||||
];
|
||||
|
||||
options.nixowos.${name} = {
|
||||
|
|
|
|||
33
graphical/virt.nix
Normal file
33
graphical/virt.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
name = "virt";
|
||||
cfg = config.nixowos.graphical.${name};
|
||||
in
|
||||
{
|
||||
options.nixowos.graphical.${name} = {
|
||||
enable = lib.mkEnableOption name;
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.user != null;
|
||||
message = "you must set nixowos.graphical.${name}.user";
|
||||
}
|
||||
];
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
virtualisation.libvirtd.enable = true;
|
||||
users.users.${cfg.user}.extraGroups = [ "libvirtd" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue