stockholm/lass/2configs/libvirt.nix

24 lines
517 B
Nix
Raw Normal View History

2015-12-26 04:55:13 +00:00
{ config, lib, pkgs, ... }:
2015-12-12 17:05:19 +00:00
let
mainUser = config.users.extraUsers.mainUser;
2016-02-17 14:00:18 +00:00
inherit (config.krebs.lib) genid;
2015-12-12 17:05:19 +00:00
in {
virtualisation.libvirtd.enable = true;
users.extraUsers = {
libvirt = {
2016-02-17 14:00:18 +00:00
uid = genid "libvirt";
2015-12-12 17:05:19 +00:00
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
'';
}