Fix on sleep with Nvidia cards and add new wallpaper

This commit is contained in:
2026-04-04 23:10:07 +02:00
parent 11a14d2a95
commit 64ee515ac2
6 changed files with 80 additions and 7 deletions
+2
View File
@@ -22,10 +22,12 @@ in
papers
celluloid
resources
gnome-system-monitor
]
++ [
# Gnome files explorer
nautilus
refine
];
};
+18 -2
View File
@@ -1,4 +1,8 @@
{ lib, config, ... }:
{
lib,
config,
...
}:
with lib;
let
cfg = config.os.graphics.nvidia;
@@ -9,16 +13,28 @@ in
};
config = mkIf cfg.enable {
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.videoDrivers = [
"modesetting"
"nvidia"
];
hardware.graphics.enable = true;
hardware.nvidia = {
open = true;
nvidiaSettings = false;
modesetting.enable = true; # Wayland requirements
powerManagement.enable = true;
prime = {
intelBusId = "PCI:0@0:2:0";
nvidiaBusId = "PCI:1@0:0:0";
};
};
os.graphics.nvidia.systemd.enable = true;
};
}
+55
View File
@@ -0,0 +1,55 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.graphics.nvidia.systemd;
in
{
options.os.graphics.nvidia.systemd = {
enable = mkEnableOption "System nvidia service";
};
config = mkIf cfg.enable {
systemd = {
services.systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; # Uncertain if this is still required or not.
services."gnome-suspend" = {
description = "suspend gnome shell";
before = [
"systemd-suspend.service"
"systemd-hibernate.service"
"nvidia-suspend.service"
"nvidia-hibernate.service"
];
wantedBy = [
"systemd-suspend.service"
"systemd-hibernate.service"
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.procps}/bin/pkill -f -STOP ${pkgs.gnome-shell}/bin/gnome-shell";
};
};
services."gnome-resume" = {
description = "resume gnome shell";
after = [
"systemd-suspend.service"
"systemd-hibernate.service"
"nvidia-resume.service"
];
wantedBy = [
"systemd-suspend.service"
"systemd-hibernate.service"
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.procps}/bin/pkill -f -CONT ${pkgs.gnome-shell}/bin/gnome-shell";
};
};
};
};
}