stockholm/lass/2configs/libvirt.nix
2015-12-26 05:58:37 +01:00

23 lines
485 B
Nix

{ config, lib, pkgs, ... }:
let
mainUser = config.users.extraUsers.mainUser;
in {
virtualisation.libvirtd.enable = true;
users.extraUsers = {
libvirt = {
uid = lib.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
'';
}