summaryrefslogtreecommitdiffstats
path: root/lass/2configs/libvirt.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-14 17:04:32 +0100
committermakefu <github@syntax-fehler.de>2015-12-14 17:04:32 +0100
commit8114470587b5c0018cdfcb6b0c0da93bfece5a05 (patch)
tree343ca79a42402fca2b66af3579aa8d11e891cd7f /lass/2configs/libvirt.nix
parent781573b9dd393aa4d2d7e34a1fa8d831441b545b (diff)
parent6f150af8acf2195188518bf53d0330da7a4bb8f8 (diff)
Merge branch 'master' of gum:stockholm
Diffstat (limited to 'lass/2configs/libvirt.nix')
-rw-r--r--lass/2configs/libvirt.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/lass/2configs/libvirt.nix b/lass/2configs/libvirt.nix
new file mode 100644
index 000000000..368722e77
--- /dev/null
+++ b/lass/2configs/libvirt.nix
@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+let
+ mainUser = config.users.extraUsers.mainUser;
+
+in {
+ virtualisation.libvirtd.enable = true;
+
+ users.extraUsers = {
+ libvirt = {
+ uid = 358821352; # genid libvirt
+ description = "user for running libvirt stuff";
+ home = "/home/libvirt";
+ useDefaultShell = true;
+ extraGroups = [ "libvirtd" "audio" ];
+ createHome = true;
+ };
+ };
+ security.sudo.extraConfig = ''
+ ${mainUser.name} ALL=(libvirt) NOPASSWD: ALL
+ '';
+}