mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
removed readFile of self which rebuilt every change
This commit is contained in:
parent
1d2844a34f
commit
ca1c54245f
6 changed files with 179 additions and 30 deletions
57
hosts/gerg-desktop/1_mon.conf
Normal file
57
hosts/gerg-desktop/1_mon.conf
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
Section "InputClass"
|
||||
Identifier "libinput mouse configuration"
|
||||
MatchDriver "libinput"
|
||||
MatchIsPointer "on"
|
||||
Option "AccelerationProfile" "0"
|
||||
Option "AccelerationScheme" "flat"
|
||||
Option "AccelSpeed" "3"
|
||||
Option "LeftHanded" "off"
|
||||
Option "MiddleEmulation" "on"
|
||||
Option "NaturalScrolling" "off"
|
||||
Option "ScrollMethod" "twofinger"
|
||||
Option "HorizontalScrolling" "on"
|
||||
Option "SendEventsMode" "enabled"
|
||||
Option "Tapping" "on"
|
||||
Option "TappingDragLock" "on"
|
||||
Option "DisableWhileTyping" "off"
|
||||
Option "Resolution" "3000"
|
||||
EndSection
|
||||
|
||||
Section "ServerFlags"
|
||||
Option "StandbyTime" "0"
|
||||
Option "SuspendTime" "0"
|
||||
Option "OffTime" "0"
|
||||
Option "BlankTime" "0"
|
||||
EndSection
|
||||
|
||||
Section "ServerLayout"
|
||||
Identifier "X.org Configured"
|
||||
Screen 0 "Screen0" 0 0
|
||||
EndSection
|
||||
|
||||
Section "Module"
|
||||
Load "glx"
|
||||
EndSection
|
||||
|
||||
Section "Monitor"
|
||||
Identifier "Monitor0"
|
||||
VendorName "Monitor Vendor"
|
||||
ModelName "Monitor Model"
|
||||
Option "Primary" "true"
|
||||
Modeline "1920x1080_144" 332.75 1920 1952 2016 2080 1080 1084 1089 1111 +HSync +VSync
|
||||
Option "PreferredMode" "1920x1080_144"
|
||||
Option "DPMS" "false"
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "Card0"
|
||||
Driver "amdgpu"
|
||||
BusID "PCI:15:0:0"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "Screen0"
|
||||
Device "Card0"
|
||||
Monitor "Monitor0"
|
||||
Option "TearFree" "true"
|
||||
EndSection
|
||||
62
hosts/gerg-desktop/2_mon.conf
Normal file
62
hosts/gerg-desktop/2_mon.conf
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
Section "ServerFlags"
|
||||
Option "AllowMouseOpenFail" "on"
|
||||
Option "DontZap" "on"
|
||||
Option "StandbyTime" "0"
|
||||
Option "SuspendTime" "0"
|
||||
Option "OffTime" "0"
|
||||
Option "BlankTime" "0"
|
||||
EndSection
|
||||
|
||||
Section "Monitor"
|
||||
Identifier "Monitor"
|
||||
Option "DPMS" "false"
|
||||
EndSection
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput mouse configuration"
|
||||
MatchDriver "libinput"
|
||||
MatchIsPointer "on"
|
||||
Option "AccelerationProfile" "0"
|
||||
Option "AccelerationScheme" "flat"
|
||||
Option "AccelSpeed" "3"
|
||||
Option "LeftHanded" "off"
|
||||
Option "MiddleEmulation" "on"
|
||||
Option "NaturalScrolling" "off"
|
||||
Option "ScrollMethod" "twofinger"
|
||||
Option "HorizontalScrolling" "on"
|
||||
Option "SendEventsMode" "enabled"
|
||||
Option "Tapping" "on"
|
||||
Option "TappingDragLock" "on"
|
||||
Option "DisableWhileTyping" "off"
|
||||
Option "Resolution" "3000"
|
||||
EndSection
|
||||
|
||||
Section "ServerLayout"
|
||||
Identifier "layout"
|
||||
Screen 0 "nvidia"
|
||||
Inactive "amdgpu"
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "nvidia"
|
||||
Driver "nvidia"
|
||||
BusID "PCI:1:0:0"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "nvidia"
|
||||
Device "nvidia"
|
||||
Option "AllowEmptyInitialConfiguration"
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "amdgpu"
|
||||
Driver "amdgpu"
|
||||
BusID "PCI:15:0:0"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "amdgpu"
|
||||
Device "amdgpu"
|
||||
EndSection
|
||||
|
||||
|
|
@ -43,8 +43,22 @@ let
|
|||
###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");
|
||||
"Xorg/1_mon.conf".source = pkgs.runCommand "1_mon.conf" {} (
|
||||
xserverbase
|
||||
+ ''
|
||||
cat << EOF >> $out
|
||||
${builtins.readFile ./1_mon.conf}
|
||||
EOF
|
||||
''
|
||||
);
|
||||
"Xorg/2_mon.conf".source = pkgs.runCommand "2_mon.conf" {} (
|
||||
xserverbase
|
||||
+ ''
|
||||
cat << EOF >> $out
|
||||
${builtins.readFile ./2_mon.conf}
|
||||
EOF
|
||||
''
|
||||
);
|
||||
};
|
||||
####VM SOUND BORKED
|
||||
services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire;
|
||||
|
|
@ -103,9 +117,9 @@ in {
|
|||
|
||||
users.users.gerg.extraGroups = ["kvm" "libvirtd"];
|
||||
|
||||
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /etc/Xorg/current"];
|
||||
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /etc/Xorg/active.conf"];
|
||||
services.xserver.displayManager.sessionCommands = lib.mkBefore ''
|
||||
if ! [ -e "/tmp/ONE_MONITOR" ] ; then
|
||||
if ! [ -e "/etc/Xorg/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
|
||||
|
|
@ -127,8 +141,8 @@ 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 /etc/Xorg/1_mon /etc/Xorg/current
|
||||
touch /tmp/ONE_MONITOR
|
||||
ln -fs /etc/Xorg/1_mon.conf /etc/Xorg/active.conf
|
||||
touch /etc/Xorg/ONE_MONITOR
|
||||
systemctl start display-manager.service
|
||||
fi
|
||||
if [ "$OPERATION" == "release" ]; then
|
||||
|
|
@ -139,14 +153,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 /etc/Xorg/2_mon /etc/Xorg/current
|
||||
rm /tmp/ONE_MONITOR
|
||||
ln -fs /etc/Xorg/2_mon.conf /etc/Xorg/active.conf
|
||||
rm /etc/Xorg/ONE_MONITOR
|
||||
systemctl start display-manager.service
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
in [
|
||||
"L /etc/Xorg/current - - - - /etc/Xorg/2_mon"
|
||||
"L /etc/Xorg/active.conf - - - - /etc/Xorg/2_mon.conf"
|
||||
"L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}"
|
||||
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${self}/misc/Windows.xml"
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue