nixos-config/profiles/virtualisation.nix

33 lines
718 B
Nix
Raw Normal View History

2021-10-24 23:15:08 +03:00
{ config, lib, pkgs, ... }:
with config.deviceSpecific; {
2022-02-01 05:17:22 +03:00
config = lib.mkIf enableVirtualisation {
virtualisation.docker = {
2022-09-23 21:26:59 +03:00
enable = true;
2022-02-01 05:17:22 +03:00
};
2022-03-22 06:01:10 +03:00
virtualisation.oci-containers.backend = "docker";
2021-02-07 02:38:11 +03:00
2022-02-01 05:17:22 +03:00
virtualisation.libvirtd = {
enable = !isServer;
qemu = {
ovmf.enable = true;
runAsRoot = true;
package = pkgs.qemu;
};
onBoot = "ignore";
onShutdown = "shutdown";
2021-10-27 15:19:41 +03:00
};
2021-02-07 02:38:11 +03:00
2022-02-01 05:17:22 +03:00
virtualisation.spiceUSBRedirection.enable = true;
networking.nat = {
enable = true;
internalInterfaces = [ "ve-+" ];
};
2021-09-15 18:37:21 +03:00
2022-03-22 06:01:10 +03:00
environment.systemPackages = with pkgs; if isServer then [
2022-02-01 05:17:22 +03:00
] else [
2022-09-23 21:26:59 +03:00
docker-compose
2022-02-01 05:17:22 +03:00
virt-manager
];
2021-09-15 18:37:21 +03:00
};
2021-02-07 02:38:11 +03:00
}