refactor: rename global from faucet

This commit is contained in:
514fpv 2024-01-07 22:01:31 +08:00
parent a28c7b9fb3
commit 95dd5cbd6c
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
31 changed files with 40 additions and 40 deletions

View file

@ -0,0 +1,33 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.libvirt;
in {
options.global.libvirt = {
enable = mkEnableOption "libvirt virtualisation daemon" // { default = true; };
};
config = mkIf cfg.enable {
virtualisation.libvirtd = {
enable = true;
qemu.runAsRoot = false;
qemu.swtpm.enable = true;
# disable as much implicit state as possible
onBoot = "ignore";
onShutdown = "shutdown";
parallelShutdown = 5;
};
# USB redirection requires a setuid wrapper
virtualisation.spiceUSBRedirection.enable = true;
environment.persistence."/nix/persist/fhs".directories = [
"/var/lib/libvirt"
];
# allow management by admin users
users.adminGroups = [ "libvirtd" ];
};
}