From 18d11407f1b1869fc563431ecebb0bdfcb58c651 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Sun, 7 Aug 2022 23:30:54 +0200 Subject: [PATCH] add thinkpad hardware-configuration.nix --- thinkpad/configuration.nix | 2 +- thinkpad/hardware-configuration.nix | 40 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 thinkpad/hardware-configuration.nix diff --git a/thinkpad/configuration.nix b/thinkpad/configuration.nix index 1537f6a..c0a38f7 100644 --- a/thinkpad/configuration.nix +++ b/thinkpad/configuration.nix @@ -2,7 +2,7 @@ { imports = [ - ../hardware-configuration.nix + ./hardware-configuration.nix ../common/configuration.nix ]; diff --git a/thinkpad/hardware-configuration.nix b/thinkpad/hardware-configuration.nix new file mode 100644 index 0000000..8998e27 --- /dev/null +++ b/thinkpad/hardware-configuration.nix @@ -0,0 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/551542c4-8817-496d-8a7d-654f6acafd51"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D414-7DBB"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +}