mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-05 01:37:24 +08:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
@@ -1,44 +1,56 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let inherit (lib) mkDefault mkIf;
|
||||
let
|
||||
inherit (lib) mkDefault mkIf;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../common/pc/laptop
|
||||
../../common/pc/ssd
|
||||
imports = [
|
||||
../../common/pc/laptop
|
||||
../../common/pc/ssd
|
||||
../../common/hidpi.nix
|
||||
../../common/gpu/24.05-compat.nix
|
||||
];
|
||||
];
|
||||
|
||||
# Necessary kernel modules
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "thunderbolt" ];
|
||||
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
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
|
||||
];
|
||||
# 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
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
(
|
||||
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
||||
vaapiIntel
|
||||
else
|
||||
intel-vaapi-driver
|
||||
)
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
# 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"
|
||||
];
|
||||
boot.kernelParams = [
|
||||
# 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
|
||||
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.
|
||||
# Set manually, as the hiDPI module had incorrect settings prior to NixOS 22.11; see nixpkgs#194594.
|
||||
hinting.enable = mkDefault false;
|
||||
antialias = mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "22.11") false;
|
||||
};
|
||||
# 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 = mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "22.11") false;
|
||||
};
|
||||
|
||||
# More HiDPI settings
|
||||
services.xserver.dpi = 280;
|
||||
# More HiDPI settings
|
||||
services.xserver.dpi = 280;
|
||||
|
||||
# Necessary for audio support on the 1195G7 model
|
||||
boot.extraModprobeConfig = ''
|
||||
options snd-intel-dspcfg dsp_driver=1
|
||||
'';
|
||||
# Necessary for audio support on the 1195G7 model
|
||||
boot.extraModprobeConfig = ''
|
||||
options snd-intel-dspcfg dsp_driver=1
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let inherit (lib) mkIf mkDefault;
|
||||
let
|
||||
inherit (lib) mkIf mkDefault;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -17,7 +18,8 @@ in
|
||||
|
||||
kernelParams = [
|
||||
# The GPD Pocket 4 uses a tablet LTPS display, that is mounted rotated 90° counter-clockwise
|
||||
"fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up"
|
||||
"fbcon=rotate:1"
|
||||
"video=eDP-1:panel_orientation=right_side_up"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
{ config, lib, ...}:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../common/cpu/intel
|
||||
../../common/pc/ssd
|
||||
];
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
"fbcon=rotate:1"
|
||||
"video=eDP-1:panel_orientation=right_side_up"
|
||||
];
|
||||
|
||||
services.tlp.enable = lib.mkDefault ((lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
||||
|| !config.services.power-profiles-daemon.enable);
|
||||
services.tlp.enable = lib.mkDefault (
|
||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
||||
|| !config.services.power-profiles-daemon.enable
|
||||
);
|
||||
|
||||
# Required for grub to properly display the boot menu.
|
||||
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, lib, ...}:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
@@ -12,6 +12,10 @@ with lib;
|
||||
hardware.sensor.iio.bmi260.enable = lib.mkDefault true;
|
||||
|
||||
#see README
|
||||
boot.blacklistedKernelModules = mkIf config.hardware.sensor.iio.bmi260.enable [ "bmi160_spi" "bmi160_i2c" "bmi160_core" ];
|
||||
boot.blacklistedKernelModules = mkIf config.hardware.sensor.iio.bmi260.enable [
|
||||
"bmi160_spi"
|
||||
"bmi160_i2c"
|
||||
"bmi160_core"
|
||||
];
|
||||
hardware.sensor.iio.enable = mkIf config.hardware.sensor.iio.bmi260.enable true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.hardware.gpd.ppt;
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.hardware.gpd.ppt;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../common/pc/laptop
|
||||
|
||||
Reference in New Issue
Block a user