summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-12-12 18:05:19 +0100
committerlassulus <lass@aidsballs.de>2015-12-12 18:05:19 +0100
commitc8b82b0336f0913c70b5d1e51b0c1194ba9570d4 (patch)
treea8de4a662bc954850d0cdda52a237c44615e68ba /lass
parente59542f12d269f4f10b1f32f2f58e3c26c27585a (diff)
l 2: add libvirt.nix
Diffstat (limited to 'lass')
-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
+ '';
+}