-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvidia.nix
40 lines (37 loc) · 1.08 KB
/
nvidia.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs, config, lib, ... }:
{
# Enable Nvidia
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.powerManagement.enable = true;
hardware.nvidia.modesetting.enable = true;
# Workaround for Nvidia suspending on Wayland
systemd.services.gnome-shell-suspend = {
enable = true;
script = ''
${pkgs.killall}/bin/killall -STOP .gnome-shell-wr
'';
before = [
"systemd-suspend.service"
"systemd-hibernate.service"
"nvidia-suspend.service"
"nvidia-hibernate.service"
];
serviceConfig = { Type = "oneshot"; };
wantedBy = [ "systemd-suspend.service" "systemd-hibernate.service" ];
};
systemd.services.gnome-shell-resume = {
enable = true;
script = ''
${pkgs.killall}/bin/killall -CONT .gnome-shell-wr
'';
after = [
"systemd-suspend.service"
"systemd-hibernate.service"
"nvidia-suspend.service"
"nvidia-hibernate.service"
];
serviceConfig = { Type = "oneshot"; };
wantedBy = [ "systemd-suspend.service" "systemd-hibernate.service" ];
};
}