nix-conf/system/virt.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2026-03-08 17:47:36 -04:00
{
config,
pkgs,
lib,
...
}: {
2024-12-22 23:46:42 -05:00
virtualisation.containers.enable = config.u.has.container;
2024-10-18 23:42:11 -04:00
virtualisation = {
podman = {
2024-12-22 23:46:42 -05:00
enable = config.u.has.container;
2024-10-18 23:42:11 -04:00
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
};
2024-12-22 23:46:42 -05:00
virtualisation.libvirtd.enable = config.u.has.virt;
2026-03-08 17:47:36 -04:00
virtualisation.libvirtd.package = pkgs.libvirt.overrideAttrs (old: {
postPatch =
old.postPatch
+ (
let
script = pkgs.writeShellApplication {
name = "virt-secret-init-encryption-sh";
runtimeInputs = [
pkgs.coreutils
pkgs.systemd
];
text = ''exec ${pkgs.runtimeShell} "$@"'';
};
in ''
substituteInPlace src/secret/virt-secret-init-encryption.service.in \
--replace-fail /usr/bin/sh ${lib.getExe script}
''
);
});
2024-12-22 23:46:42 -05:00
programs.virt-manager.enable = config.u.has.graphical && config.u.has.virt;
2024-10-18 23:42:11 -04:00
programs.nix-ld.enable = true;
2024-12-22 23:46:42 -05:00
hardware.graphics.enable32Bit = config.u.has.graphical && config.u.has.wine;
2024-10-18 23:42:11 -04:00
}