|
| 1 | +{ config, lib, pkgs, ... }: |
| 2 | + |
| 3 | +let |
| 4 | + cfg = config.hardware.gpd.duo; |
| 5 | +in |
| 6 | +with lib; { |
| 7 | + imports = [ |
| 8 | + ./duo-specific |
| 9 | + ../../common/pc/laptop |
| 10 | + ../../common/pc/ssd |
| 11 | + ../../common/hidpi.nix |
| 12 | + ]; |
| 13 | + |
| 14 | + options = { |
| 15 | + hardware.gpd.duo.preventWakeOnAC = mkOption { |
| 16 | + type = types.bool; |
| 17 | + default = false; |
| 18 | + description = '' |
| 19 | + Stop the system waking from suspend when the AC is plugged |
| 20 | + in. The catch: it also disables waking from the keyboard. |
| 21 | +
|
| 22 | + See: |
| 23 | + https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45 |
| 24 | + ''; |
| 25 | + }; |
| 26 | + }; |
| 27 | + |
| 28 | + config = { |
| 29 | + # Workaround applied upstream in Linux >=6.7 (on BIOS 03.03) |
| 30 | + # https://github.com/torvalds/linux/commit/a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193 |
| 31 | + services.udev.extraRules = mkIf (versionOlder config.boot.kernelPackages.kernel.version "6.7" && cfg.preventWakeOnAC) '' |
| 32 | + # Prevent wake when plugging in AC during suspend. Trade-off: keyboard wake disabled. See: |
| 33 | + # https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45 |
| 34 | + ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" |
| 35 | + ''; |
| 36 | + |
| 37 | + # Replace 'left' with 'right' or 'inverted' as needed |
| 38 | + # Fixes DUO stupid inverted display at boot |
| 39 | + # Enable kernel module for your graphics (adjust if needed) |
| 40 | + boot.kernelModules = [ "amdgpu" ]; |
| 41 | + |
| 42 | + # Set the eDP-1 panel video parameters for display rotation |
| 43 | + boot.kernelParams = mkBefore [ |
| 44 | + "video=eDP-1:2880x1800,panel_orientation=upside_down" |
| 45 | + "video=DP-3:2880x1800" |
| 46 | + "i2c_touchscreen_props=GXTP7380:touchscreen-inverted-x:touchscreen-inverted-y" |
| 47 | + ]; |
| 48 | + |
| 49 | + hardware.gpd.duo.audioEnhancement.rawDeviceName = mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; |
| 50 | + }; |
| 51 | +} |
0 commit comments