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 = {
|
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";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue