From de2ea2beee098e96baafd7cc3250e1e768294994 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 5 Oct 2022 15:57:50 +0200 Subject: [PATCH 1/3] Add GPD Pocket 3 module to nixos-hardware --- gpd/pocket-3/default.nix | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 gpd/pocket-3/default.nix diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix new file mode 100644 index 0000000..d2f4bf2 --- /dev/null +++ b/gpd/pocket-3/default.nix @@ -0,0 +1,43 @@ +{ lib, pkgs, ... }: +let inherit (lib) mkDefault; +in +{ + imports = [ + ../../common/pc/laptop + ../../common/pc/laptop/ssd + ]; + + # Necessary kernel modules + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "thunderbolt" ]; + + # GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU + boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays + services.xserver.videoDrivers = [ "intel" ]; + hardware.opengl.extraPackages = with pkgs; [ intel-media-driver vaapiIntel ]; + + boot.kernelParams = [ + # S3 suspend is broken as of Sept. 2022 (screen does not come back properly), use S2 + "mem_sleep_default=s2idle" + + # The GPD Pocket3 uses a tablet OLED display, that is mounted rotated 90° counter-clockwise + "fbcon=rotate:1" "video=DSI-1:panel_orientation=right_side_up" + ]; + + fonts.fontconfig = { + subpixel.rgba = "vbgr"; # Pixel order for rotated screen + + # The OLED display has √(1920² + 1200²) px / 8in ≃ 283 dpi + # Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow. + hinting.enable = mkDefault false; + antialias = false; #TODO(nicoo): Fix nixpkgs' HiDPI module + }; + + # More HiDPI settings + hardware.video.hidpi.enable = true; + services.xserver.dpi = 280; + + # Necessary for audio support on the 1195G7 model + boot.extraModprobeConfig = '' + options snd-intel-dspcfg dsp_driver=1 + ''; +} From 1c535dc0497f7f4f92a562f8d033abf944bfc3e2 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 5 Oct 2022 16:41:29 +0200 Subject: [PATCH 2/3] gpd/pocket-3: Only workaround hidpi module bug on NixOS < 22.11 Assumes NixOS/nixpkgs#194594 gets merged. --- gpd/pocket-3/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index d2f4bf2..59de138 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -1,5 +1,5 @@ { lib, pkgs, ... }: -let inherit (lib) mkDefault; +let inherit (lib) mkDefault mkIf; in { imports = [ @@ -28,8 +28,9 @@ in # The OLED display has √(1920² + 1200²) px / 8in ≃ 283 dpi # Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow. + # Set manually, as the hiDPI module had incorrect settings prior to NixOS 22.11; see nixpkgs#194594. hinting.enable = mkDefault false; - antialias = false; #TODO(nicoo): Fix nixpkgs' HiDPI module + antialias = mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "22.11") false; }; # More HiDPI settings From d5de1c72cfcee3dfaeacc5878f7a77ccc9270897 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 5 Oct 2022 19:23:38 +0200 Subject: [PATCH 3/3] Update README & flake.nix --- README.md | 1 + flake.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 3978d37..3dc3768 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ See code for all available configurations. | [Framework](framework) | `` | | [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | | [GPD MicroPC](gpd/micropc) | `` | +| [GPD Pocket 3](gpd/pocket-3) | `` | | [Google Pixelbook](google/pixelbook) | `` | | [HP Elitebook 2560p](hp/elitebook/2560p) | `` | | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | diff --git a/flake.nix b/flake.nix index 990f44f..f8d6559 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,7 @@ friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; google-pixelbook = import ./google/pixelbook; gpd-micropc = import ./gpd/micropc; + gpd-pocket-3 = import ./gpd/pocket-3; hp-elitebook-2560p = import ./hp/elitebook/2560p; intel-nuc-8i7beh = import ./intel/nuc/8i7beh; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510;