tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
amd-hybrid-graphics: fix race condition
Linus Heckemann
9 years ago
689d8349
67c92e92
+11
-4
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
hardware
amd-hybrid-graphics.nix
+11
-4
nixos/modules/services/hardware/amd-hybrid-graphics.nix
···
25
25
path = [ pkgs.bash ];
26
26
description = "Disable AMD Card";
27
27
after = [ "sys-kernel-debug.mount" ];
28
28
-
requires = [ "sys-kernel-debug.mount" ];
29
29
-
wantedBy = [ "multi-user.target" ];
28
28
+
before = [ "systemd-vconsole-setup.service" "display-manager.service" ];
29
29
+
requires = [ "sys-kernel-debug.mount" "vgaswitcheroo.path" ];
30
30
serviceConfig = {
31
31
Type = "oneshot";
32
32
RemainAfterExit = true;
33
33
-
ExecStart = "${pkgs.bash}/bin/sh -c 'echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch; exit 0'";
34
34
-
ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch; exit 0'";
33
33
+
ExecStart = "${pkgs.bash}/bin/sh -c 'echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch'";
34
34
+
ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch'";
35
35
+
};
36
36
+
};
37
37
+
systemd.paths."vgaswitcheroo" = {
38
38
+
pathConfig = {
39
39
+
PathExists = "/sys/kernel/debug/vgaswitcheroo/switch";
40
40
+
Unit = "amd-hybrid-graphics.service";
35
41
};
42
42
+
wantedBy = ["multi-user.target"];
36
43
};
37
44
};
38
45