diff --git a/hosts/buskerud/configuration.nix b/hosts/buskerud/configuration.nix index 14eec653..1b4b4613 100644 --- a/hosts/buskerud/configuration.nix +++ b/hosts/buskerud/configuration.nix @@ -4,6 +4,8 @@ ./hardware-configuration.nix ../../base.nix ../../misc/metrics-exporters.nix + + ./services/libvirt.nix ]; # buskerud does not support efi? diff --git a/hosts/buskerud/services/libvirt.nix b/hosts/buskerud/services/libvirt.nix new file mode 100644 index 00000000..01eae001 --- /dev/null +++ b/hosts/buskerud/services/libvirt.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: +{ + virtualisation.libvirtd.enable = true; + programs.dconf.enable = true; + boot.kernelModules = [ "kvm-intel" ]; + + # On a gui-enabled machine, connect with: + # $ virt-manager --connect "qemu+ssh://buskerud/system?socket=/var/run/libvirt/libvirt-sock" +} + diff --git a/users/felixalb.nix b/users/felixalb.nix index fb496d25..5db68422 100644 --- a/users/felixalb.nix +++ b/users/felixalb.nix @@ -1,8 +1,12 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: { users.users.felixalb = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ + "wheel" + ] ++ lib.optionals ( config.users.groups ? "libvirtd" ) [ + "libvirtd" + ]; shell = pkgs.zsh; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDKzPICGew7uN0cmvRmbwkwTCodTBUgEhkoftQnZuO4Q felixalbrigtsen@gmail.com"