From 1586111aebf2b3b17ea704faca22523d03b4654f Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 2 Jul 2023 02:50:51 +0200 Subject: [PATCH] dumpyourvms: add condition for switching off 2nd GPU --- hosts/dumpyourvms/dumpyourvms.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/dumpyourvms/dumpyourvms.nix b/hosts/dumpyourvms/dumpyourvms.nix index aac82bf7..81ec0d20 100644 --- a/hosts/dumpyourvms/dumpyourvms.nix +++ b/hosts/dumpyourvms/dumpyourvms.nix @@ -91,7 +91,7 @@ in { serviceConfig = { Type = "oneshot"; RemainAfterExit = true; - ExecStart = "${pkgs.bash}/bin/sh -c 'sleep 7 && echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch'"; + ExecStart = "${pkgs.bash}/bin/sh -c 'sleep 7 && if grep --quiet 'IGD:+' /sys/kernel/debug/vgaswitcheroo/switch; then echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch; fi'"; ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch'"; }; wantedBy = ["multi-user.target"];