mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
use tmpfile.d to symlink vfio things
This commit is contained in:
parent
7bc746dbd1
commit
d911aabfad
2 changed files with 6 additions and 11 deletions
|
|
@ -25,6 +25,7 @@ in {
|
|||
displayManager = {
|
||||
sessionCommands = ''
|
||||
${pkgs.feh}/bin/feh --bg-scale ${self + /misc/recursion.png}
|
||||
${pkgs.numlockx}/bin/numlockx
|
||||
'';
|
||||
defaultSession = "none+dwm";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ _: {
|
|||
|
||||
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");
|
||||
qemuHook = pkgs.writeScript "qemu-hook" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
|
|
@ -58,14 +58,8 @@ _: {
|
|||
fi
|
||||
fi
|
||||
'';
|
||||
in ''
|
||||
mkdir -p /var/lib/libvirt/hooks
|
||||
chmod 755 /var/lib/libvirt/hooks
|
||||
|
||||
# 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
|
||||
'';
|
||||
in [
|
||||
"L+ /var/lib/libvirt/hooks/ - - - - ${qemuHook}"
|
||||
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${xml}"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue