nix-config/modules/nix/virt/qemu.nix
smayzy 34775227e9
All checks were successful
nixos config pipeline / show-flake (push) Successful in 23s
nixos config pipeline / deploy (push) Successful in 2m6s
update #TODO rewrite nvim config
2025-10-19 15:20:16 +02:00

33 lines
735 B
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkIf mkOption types;
in
{
options.smayzy.virt.enable = mkOption {
type = types.bool;
default = false;
description = "enable virt-manager and qemu";
};
config = mkIf config.smayzy.virt.enable {
# chmod g+x ~/VM
# for traversability of the home dir
programs.virt-manager.enable = true;
users.groups.libvirtd.members = [ "smayzy" ];
virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.qemu.runAsRoot = false;
environment.systemPackages = with pkgs; [
qemu_kvm
];
# https://wiki.nixos.org/wiki/QEMU
systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ];
};
}