diff --git a/configuration.nix b/configuration.nix index 7ae3e9e..9eef564 100644 --- a/configuration.nix +++ b/configuration.nix @@ -6,15 +6,8 @@ with pkgs; # Kernel configuration boot = { kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; - kernelParams = [ - "zfs.zfs_arc_max=2147483648" - "zfs.zfs_arc_meta_limit_percent=90" - "workqueue.power_efficient=y" - "ahci.mobile_lpm_policy=3" - "nmi_watchdog=0" - "msr.allow_writes=on" - ]; - kernelModules = [ "i915" ]; + kernelParams = + [ "zfs.zfs_arc_max=2147483648" "zfs.zfs_arc_meta_limit_percent=90" ]; blacklistedKernelModules = [ "btusb" "bluetooth" ]; supportedFilesystems = [ "zfs" ]; zfs = { @@ -23,14 +16,9 @@ with pkgs; }; }; - # Intel CPU tweaks - hardware.enableRedistributableFirmware = true; + # Device firmware updates services.fwupd.enable = true; - # Hardware video acceleration - hardware.opengl.extraPackages = - [ intel-media-driver vaapiIntel vaapiVdpau libvdpau-va-gl ]; - # Bootloader configuration boot.loader = { efi.canTouchEfiVariables = true; diff --git a/modules/hardware-configuration.nix b/modules/hardware-configuration.nix deleted file mode 100644 index 3938f49..0000000 --- a/modules/hardware-configuration.nix +++ /dev/null @@ -1,72 +0,0 @@ -# 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" "nvme" "usbhid" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "syscea/stateful/root"; - fsType = "zfs"; - }; - - fileSystems."/nix" = - { device = "syscea/ephemeral/nix"; - fsType = "zfs"; - }; - - fileSystems."/ugent" = - { device = "systemd-1"; - fsType = "autofs"; - }; - - fileSystems."/tmp" = - { device = "syscea/ephemeral/tmp"; - fsType = "zfs"; - }; - - fileSystems."/home/coolneng" = - { device = "syscea/stateful/home"; - fsType = "zfs"; - }; - - fileSystems."/home/coolneng/Downloads" = - { device = "syscea/stateful/home/downloads"; - fsType = "zfs"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4851-6B40"; - fsType = "vfat"; - }; - - fileSystems."/home/coolneng/Videos" = - { device = "syscea/stateful/home/videos"; - fsType = "zfs"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/1f0ea09c-e655-4a9f-83d4-9d396de01720"; } - ]; - - # 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.wg0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/modules/power.nix b/modules/power.nix index 1983a62..c8326b7 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -1,18 +1,8 @@ { config, lib, pkgs, ... }: { - # Enable the TLP daemon - services.tlp = { - enable = true; - settings = { - PCIE_ASPM_ON_AC = "performance"; - PCIE_ASPM_ON_BAT = "powersave"; - USB_AUTOSUSPEND = 1; - }; - }; - - # Enable the auto-cpufreq daemon - services.auto-cpufreq.enable = true; + # Enable power-profiles-daemon + services.power-profiles-daemon.enable = true; # Suspend when the battery is critical and autosuspend USB and PCI services.udev.extraRules = '' @@ -20,45 +10,4 @@ ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto" ACTION=="add", SUBSYSTEM=="pci", TEST=="power/control", ATTR{power/control}="auto" ''; - - # Undervolt CPU and GPU - services.undervolt = { - enable = true; - coreOffset = -100; - gpuOffset = -75; - }; - - # Prevent overheating of the CPU - services.thermald.enable = true; - - # HACK Enable internal microphone when headphones are plugged in and add workaround for frequent WiFi disconnects - hardware.firmware = [ - (pkgs.writeTextDir "/lib/firmware/hda-jack-retask.fw" '' - [codec] - 0x10ec0293 0x17aa2233 0 - - [pincfg] - 0x12 0x90a60130 - 0x13 0x40000000 - 0x14 0x90170110 - 0x15 0x03211040 - 0x16 0x21211010 - 0x18 0x411111f0 - 0x19 0x21a11010 - 0x1a 0x40f000f0 - 0x1b 0x411111f0 - 0x1d 0x40738105 - 0x1e 0x411111f0 - '') - ]; - - # Power saving features for multiple devices - boot.extraModprobeConfig = '' - options snd-hda-intel patch=hda-jack-retask.fw power_save=1 - options mac80211 beacon_loss_count=500 - options iwlwifi power_save=1 - options iwlmvm power_scheme=3 - options i915 enable_guc=2 - ''; - }