@@ -9,6 +9,7 @@
|
||||
};
|
||||
|
||||
environment.persistence."/persist"."/var/lib/bluetooth" = { };
|
||||
|
||||
systemd.services.bluetooth.after = [
|
||||
config.environment.persistence."/persist"."/var/lib/bluetooth".mount
|
||||
];
|
||||
|
34
hosts/common/system/configs/libvirt/default.nix
Normal file
34
hosts/common/system/configs/libvirt/default.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
swtpm.enable = true;
|
||||
ovmf.packages = [ pkgs.OVMFFull.fd ];
|
||||
};
|
||||
};
|
||||
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
|
||||
systemd.services.libvirtd-network-default = {
|
||||
description = "Start Default Virtual Network for Libvirt";
|
||||
script = "${config.virtualisation.libvirtd.package}/bin/virsh net-start default";
|
||||
preStop = "${config.virtualisation.libvirtd.package}/bin/virsh net-destroy default";
|
||||
serviceConfig.Type = "oneshot";
|
||||
wantedBy = [ "libvirtd.service" ];
|
||||
after = [ "libvirtd.service" ];
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [ config.virtualisation.libvirtd.qemu.swtpm.package ];
|
||||
etc = {
|
||||
"ovmf/edk2-x86_64-secure-code.fd".source = "${config.virtualisation.libvirtd.qemu.package}/share/qemu/edk2-x86_64-secure-code.fd";
|
||||
"ovmf/edk2-i386-vars.fd".source = "${config.virtualisation.libvirtd.qemu.package}/share/qemu/edk2-i386-vars.fd";
|
||||
};
|
||||
persistence."/persist"."/var/lib/libvirt" = { };
|
||||
};
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
}
|
16
hosts/common/user/configs/console/libvirt/default.nix
Normal file
16
hosts/common/user/configs/console/libvirt/default.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home-manager.users.${user}.dconf.settings = {
|
||||
"org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
uris = [ "qemu:///system" ];
|
||||
};
|
||||
"org/virt-manager/virt-manager".xmleditor-enabled = true;
|
||||
};
|
||||
|
||||
users.users.${user}.extraGroups = [ "libvirtd" ];
|
||||
}
|
Reference in New Issue
Block a user