From 256f598a1b48455fd8b844d6e29cda08b9674c5b Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:42:46 +0200 Subject: [PATCH] fix(tuxedo/pulse/15/gen2): properly suspend the system --- tuxedo/pulse/15/gen2/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tuxedo/pulse/15/gen2/default.nix b/tuxedo/pulse/15/gen2/default.nix index 8398a24..506be8a 100644 --- a/tuxedo/pulse/15/gen2/default.nix +++ b/tuxedo/pulse/15/gen2/default.nix @@ -1,7 +1,20 @@ { + lib, + pkgs, + ... +}: { imports = [ ../../../../common/cpu/amd ../../../../common/gpu/amd ../../../../common/pc/laptop/ssd ]; + + services.udev.extraRules = lib.concatStringsSep "\n" ( + ["# Properly suspend the system."] + ++ ( + map + (device: "SUBSYSTEM==\"pci\", ACTION==\"add\", ATTR{vendor}==\"0x144d\", ATTR{device}==\"${device}\", RUN+=\"${pkgs.bash}/bin/sh -c '${pkgs.coreutils}/bin/echo 0 | ${pkgs.coreutils}/bin/tee /sys/bus/pci/devices/$kernel/d3cold_allowed'\"") + ["0xa80a" "0xa808"] + ) + ); }