nixos/modules/gpuPassthrough/default.nix
2024-05-08 12:29:11 +02:00

26 lines
No EOL
582 B
Nix

{ config, pkgs, lib, ... }:
with lib;
{
options.customModules.gpuPassthrough = {
enable = mkEnableOption ''
Enable gpu passthgrouth with my custom configurations
'';
};
config =
let
cfg = config.customModules.gpuPassthrough;
in
mkIf cfg.enable {
programs.virt-manager.enable = true;
virtualisation.libvirtd = {
enable = true;
hooks.qemu = {
is_working = "${pkgs.writeShellScript "testHook.sh" ''
+ touch /tmp/qemu_hook_is_working
+ ''}";
};
};
};
}