File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed
Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 1616 ./system.nix
1717 ./update.nix
1818 ./version.nix
19+ ./standBy.nix
1920 ] ;
2021
2122}
Original file line number Diff line number Diff line change 4949
5050 dynamicBoost . enable = cfg . laptop ;
5151 powerManagement . enable = cfg . laptop ;
52+
5253 } ;
5354 } ;
5455}
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ config ,
4+ pkgs ,
5+ ...
6+ } :
7+
8+ {
9+
10+ options . glf . standBy . enable = lib . mkOption {
11+ description = "Enable Standby fix" ;
12+ type = lib . types . bool ;
13+ default = true ;
14+ } ;
15+
16+ config = lib . mkIf config . glf . standBy . enable {
17+
18+ boot . kernelParams = [
19+ "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
20+ "NVreg_TemporaryFilePath=/var/tmp"
21+ ] ;
22+
23+ systemd = {
24+ services . "gnome-suspend" = {
25+ description = "suspend gnome shell" ;
26+ before = [
27+ "systemd-suspend.service"
28+ "systemd-hibernate.service"
29+ "nvidia-suspend.service"
30+ "nvidia-hibernate.service"
31+ ] ;
32+ wantedBy = [
33+ "systemd-suspend.service"
34+ "systemd-hibernate.service"
35+ ] ;
36+ serviceConfig = {
37+ Type = "oneshot" ;
38+ ExecStart = ''${ pkgs . procps } /bin/pkill -f -STOP ${ pkgs . gnome-shell } /bin/gnome-shell'' ;
39+ } ;
40+ } ;
41+ services . "gnome-resume" = {
42+ description = "resume gnome shell" ;
43+ after = [
44+ "systemd-suspend.service"
45+ "systemd-hibernate.service"
46+ "nvidia-resume.service"
47+ ] ;
48+ wantedBy = [
49+ "systemd-suspend.service"
50+ "systemd-hibernate.service"
51+ ] ;
52+ serviceConfig = {
53+ Type = "oneshot" ;
54+ ExecStart = ''${ pkgs . procps } /bin/pkill -f -CONT ${ pkgs . gnome-shell } /bin/gnome-shell'' ;
55+ } ;
56+ } ;
57+ } ;
58+
59+ } ;
60+
61+ }
You can’t perform that action at this time.
0 commit comments