Fixed nvidia

server
This commit is contained in:
Aleksandr Lebedev 2025-04-02 20:50:09 +02:00
parent 8cdc5557f9
commit b284928062
9 changed files with 341 additions and 19 deletions

View file

@ -1,11 +1,11 @@
{ pkgs, lib, ... }:
{ pkgs, lib, hwconfig, ... }:
let
suspendScript = pkgs.writeShellScript "suspend-script" ''
# check if any player has status "Playing"
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
# only suspend if nothing is playing
if [ $? == 1 ]; then
${pkgs.systemd}/bin/systemctl suspend
${if hwconfig.isLaptop then "${pkgs.systemd}/bin/systemctl suspend" else "loginctl lock-session"}
fi
'';
in