nixos-config/sets/virtualization.nix

31 lines
761 B
Nix
Raw Normal View History

2020-11-17 01:51:13 +00:00
{ config, pkgs, ... }:
{
virtualisation = {
docker.enable = true;
lxd = {
enable = true;
recommendedSysctlSettings = true;
};
2020-12-13 06:57:45 +00:00
libvirtd = {
enable = true;
qemuOvmf = true;
qemuRunAsRoot = false;
onBoot = "ignore";
onShutdown = "shutdown";
};
2020-11-17 01:51:13 +00:00
};
2020-12-13 06:57:45 +00:00
environment.systemPackages = with pkgs; [
virtmanager
];
2020-11-17 01:51:13 +00:00
users.users = {
2020-12-13 06:57:45 +00:00
artemis.extraGroups = [ "docker" "lxd" "libvirtd" ];
2020-12-02 04:17:30 +00:00
lxd = {
2020-11-26 04:20:52 +00:00
subUidRanges = [{ startUid = 16777216; count = 16777216; } { startUid = config.users.users.artemis.uid; count = 1; }];
2020-12-02 04:17:30 +00:00
subGidRanges = [{ startGid = 16777216; count = 16777216; } { startGid = 100; count = 1; } { startGid = config.users.groups.artemis.gid; count = 1; }];
2020-11-17 01:51:13 +00:00
};
};
}