removed IFD's

made t-rex slightly less scuffed

deleted afk-cmds
This commit is contained in:
Gerg-L 2023-07-03 15:31:07 -04:00
parent 04522f424d
commit 8d1ac4c573
7 changed files with 80 additions and 147 deletions

View file

@ -4,8 +4,8 @@
...
}: {
pkgs,
config,
lib,
config,
...
}:
###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136
@ -18,37 +18,34 @@ let
pkgs.xorg.fontadobe100dpi
pkgs.xorg.fontadobe75dpi
];
in
pkgs.runCommand "xserverbase"
{
fontpath =
lib.optionalString (xcfg.fontPath != null)
''FontPath "${xcfg.fontPath}"'';
inherit (xcfg) config;
preferLocalBuild = true;
}
''
echo 'Section "Files"' >> $out
echo $fontpath >> $out
for i in ${toString fontsForXServer}; do
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
for j in $(find $i -name fonts.dir); do
echo " FontPath \"$(dirname $j)\"" >> $out
done
fi
done
for i in $(find ${toString xcfg.modules} -type d); do
if test $(echo $i/*.so* | wc -w) -ne 0; then
echo " ModulePath \"$i\"" >> $out
fi
done
echo '${xcfg.filesSection}' >> $out
echo 'EndSection' >> $out
echo >> $out
'';
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/1-monitor.conf")]);
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/2-monitor.conf")]);
fontpath =
lib.optionalString (xcfg.fontPath != null)
''FontPath "${xcfg.fontPath}"'';
in ''
echo 'Section "Files"' >> $out
echo ${fontpath} >> $out
for i in ${toString fontsForXServer}; do
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
for j in $(find $i -name fonts.dir); do
echo " FontPath \"$(dirname $j)\"" >> $out
done
fi
done
for i in $(find ${toString xcfg.modules} -type d); do
if test $(echo $i/*.so* | wc -w) -ne 0; then
echo " ModulePath \"$i\"" >> $out
fi
done
echo '${xcfg.filesSection}' >> $out
echo 'EndSection' >> $out
echo >> $out
'';
###END OF TAKEN PART
in {
environment.etc = {
"Xorg/1_mon".source = pkgs.runCommand "1_mon" {} (xserverbase + "cat '${self}/misc/1-monitor.conf' >> $out");
"Xorg/2_mon".source = pkgs.runCommand "2_mon" {} (xserverbase + "cat '${self}/misc/2-monitor.conf' >> $out");
};
####VM SOUND BORKED
services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire;
boot = {
@ -106,9 +103,9 @@ in {
users.users.gerg.extraGroups = ["kvm" "libvirtd"];
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /tmp/xorg.conf"];
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /etc/Xorg/current"];
services.xserver.displayManager.sessionCommands = lib.mkBefore ''
if ! (test -e "/tmp/ONE_MONITOR"); then
if ! [ -e "/tmp/ONE_MONITOR" ] ; then
xrandr --output DP-0 --auto --mode 3440x1440 --rate 120 --primary --pos 0x0
xrandr --output HDMI-A-1-0 --auto --mode 1920x1080 --rate 144 --set TearFree on --pos 3440x360
xset -dpms
@ -130,7 +127,7 @@ in {
systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31
ln -fs ${oneMonitor} /tmp/xorg.conf
ln -fs /etc/Xorg/1_mon /etc/Xorg/current
touch /tmp/ONE_MONITOR
systemctl start display-manager.service
fi
@ -142,14 +139,14 @@ in {
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
modprobe -a nvidia_uvm nvidia_drm nvidia nvidia_modeset
ln -fs ${twoMonitor} /tmp/xorg.conf
ln -fs /etc/Xorg/2_mon /etc/Xorg/current
rm /tmp/ONE_MONITOR
systemctl start display-manager.service
fi
fi
'';
in [
"L /tmp/xorg.conf - - - - ${twoMonitor}"
"L /etc/Xorg/current - - - - /etc/Xorg/2_mon"
"L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}"
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${self}/misc/Windows.xml"
];