use tmpfile.d to symlink vfio things

This commit is contained in:
Gerg-L 2023-02-22 17:58:29 -05:00
parent 7bc746dbd1
commit d911aabfad
2 changed files with 6 additions and 11 deletions

View file

@ -25,6 +25,7 @@ in {
displayManager = { displayManager = {
sessionCommands = '' sessionCommands = ''
${pkgs.feh}/bin/feh --bg-scale ${self + /misc/recursion.png} ${pkgs.feh}/bin/feh --bg-scale ${self + /misc/recursion.png}
${pkgs.numlockx}/bin/numlockx
''; '';
defaultSession = "none+dwm"; defaultSession = "none+dwm";
}; };

View file

@ -36,7 +36,7 @@ _: {
users.users."${settings.username}".extraGroups = ["kvm" "libvirtd"]; users.users."${settings.username}".extraGroups = ["kvm" "libvirtd"];
systemd.services.libvirtd.preStart = let systemd.tmpfiles.rules = let
xml = pkgs.writeText "Windows.xml" (builtins.readFile "${self}/misc/Windows.xml"); xml = pkgs.writeText "Windows.xml" (builtins.readFile "${self}/misc/Windows.xml");
qemuHook = pkgs.writeScript "qemu-hook" '' qemuHook = pkgs.writeScript "qemu-hook" ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
@ -58,14 +58,8 @@ _: {
fi fi
fi fi
''; '';
in '' in [
mkdir -p /var/lib/libvirt/hooks "L+ /var/lib/libvirt/hooks/ - - - - ${qemuHook}"
chmod 755 /var/lib/libvirt/hooks "L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${xml}"
];
# Copy hook files
ln -sf ${qemuHook} /var/lib/libvirt/hooks/qemu
mkdir -p /var/lib/libvirt/qemu/
ln -sf ${xml} /var/lib/libvirt/qemu/Windows.xml
'';
} }