From 58103331f57386780bd9a7ec3a94d68a7460243b Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Mon, 24 Jan 2022 21:15:10 +0100 Subject: [PATCH] hp/elitebook/2560p: Initial commit --- hp/elitebook/2560p/default.nix | 22 ++++++++++++++++++++++ hp/elitebook/2560p/igpu.nix | 28 ++++++++++++++++++++++++++++ hp/elitebook/2560p/network.nix | 12 ++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 hp/elitebook/2560p/default.nix create mode 100644 hp/elitebook/2560p/igpu.nix create mode 100644 hp/elitebook/2560p/network.nix diff --git a/hp/elitebook/2560p/default.nix b/hp/elitebook/2560p/default.nix new file mode 100644 index 0000000..2055532 --- /dev/null +++ b/hp/elitebook/2560p/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: +with lib; +let + xcfg = config.services.xserver; +in +{ + imports = [ + ../../../common/cpu/intel + ../../../common/cpu/intel/sandy-bridge + ../../../common/pc + ../../../common/pc/laptop + ../../../common/pc/laptop/hdd + ../../../common/pc/hdd + + ./network.nix + ./igpu.nix + ]; + + config = { + services.thermald.enable = mkDefault true; + }; +} diff --git a/hp/elitebook/2560p/igpu.nix b/hp/elitebook/2560p/igpu.nix new file mode 100644 index 0000000..2b6c789 --- /dev/null +++ b/hp/elitebook/2560p/igpu.nix @@ -0,0 +1,28 @@ +{ config, pkgs, lib, ... }: +with lib; +let + xcfg = config.services.xserver; + cfg = config.hardware.hp.elitebook.graphics; +in +{ + options.hardware.hp.elitebook.graphics = { + enable = mkOption { + default = xcfg.enable; + example = !xcfg.enable; + description = "Wether to enable iGPU related settings for HP Elitebook laptops"; + type = types.bool; + }; + }; + + config = mkIf cfg.enable { + boot.initrd.kernelModules = [ "i915" ]; + hardware.opengl = { + enable = mkDefault true; + extraPackages = with pkgs; [ + vaapiIntel + libvdpau-va-gl + ]; + }; + }; +} + diff --git a/hp/elitebook/2560p/network.nix b/hp/elitebook/2560p/network.nix new file mode 100644 index 0000000..23c5284 --- /dev/null +++ b/hp/elitebook/2560p/network.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +with lib; +{ + config = { + # Wifi can't connect if rand mac address is used + networking.networkmanager.extraConfig = concatStringsSep "\n" [ + "[device]" + "match-device=driver:iwlwifi" + "wifi.scan-rand-mac-address=no" + ]; + }; +}