nix: update flake inputs
[julm/julm-nix.git] / hosts / oignon / hardware.nix
index 33e9c6685387199d4005e2cf1ebec5af65c764cf..e3fb24905901d04d7061ab9775514516b7809eec 100644 (file)
@@ -1,20 +1,27 @@
 { config, lib, pkgs, hostName, ... }:
 {
 hardware.cpu.intel.updateMicrocode = true;
+hardware.opengl.extraPackages = [
+  pkgs.intel-media-driver # LIBVA_DRIVER_NAME=iHD
+  pkgs.vaapiIntel         # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
+  pkgs.vaapiVdpau
+  pkgs.libvdpau-va-gl
+];
 powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 services.thinkfan = {
   enable = true;
-  levels = ''
-    (0,     0,      57)
-    (1,     56,     62)
-    (2,     61,     65)
-    (3,     64,     66)
-    (4,     65,     68)
-    (5,     67,     71)
-    (6,     70,     76)
-    (7,     75,     81)
-    (127,   80,     32767)
-  '';
+  smartSupport = true;
+  levels = [
+    [0     0      57]
+    [1     56     60]
+    [2     59     63]
+    [3     62     65]
+    [4     64     67]
+    [5     66     72]
+    [6     71     78]
+    [7     77     82]
+    [127   81     32767]
+  ];
 };
 hardware.acpilight.enable = true;
 services.acpid = {
@@ -28,42 +35,44 @@ services.acpid = {
       event = "video/brightnessup.*";
       action = "${pkgs.acpilight}/bin/xbacklight -inc 5";
     };
-    acAdapter = {
-      event = "ac_adapter/*";
-      action = ''
-        vals=($1)
-        case ''${vals[3]} in
-          00000000) # unplugged
-            ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave;;
-          00000001) # plugged in
-            ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g ondemand;;
-        esac
-      '';
-    };
   };
+  acEventCommands = ''
+    vals=($1)
+    case ''${vals[3]} in
+      00000000) # unplugged
+        ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave;;
+      00000001) # plugged in
+        ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g ondemand;;
+    esac
+  '';
 };
 
 # https://bugzilla.kernel.org/show_bug.cgi?id=110941
 boot.kernelParams = [ "intel_pstate=no_hwp" ];
-boot.kernelModules = [ "kvm-intel" ];
+boot.kernelModules = [
+  "kvm-intel"
+];
 boot.cleanTmpDir = true;
 boot.tmpOnTmpfs = true;
 boot.extraModulePackages = [
-  config.boot.kernelPackages.exfat-nofuse
+  #config.boot.kernelPackages.exfat-nofuse
 ];
+/*
+boot.loader.efi = {
+  canTouchEfiVariables = true;
+  efiSysMountPoint = "/boot/efi";
+};
+*/
+# No pstore backend available on this system.
+systemd.services.mount-pstore.enable = false;
 boot.loader.grub = {
   enable  = true;
   version = 2;
   device  = "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_128GB_S1SMNSAFC36436X";
   configurationLimit = 3;
+
   #zfsSupport = true;
-  /*
-  efiSupport = true;
-  efi = {
-    canTouchEfiVariables = false;
-    efiSysMountPoint = "/boot/efi";
-  };
-  */
+  #efiSupport = true;
   #enableCryptodisk = true;
 };
 
@@ -127,7 +136,7 @@ services.udev.extraRules = ''
   ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"
 '';
 
-boot.supportedFilesystems = [ "zfs" ];
+boot.supportedFilesystems = [ "ntfs" "vfat" "zfs" ];
 boot.initrd.supportedFilesystems = [ "zfs" ];
 boot.initrd.availableKernelModules = [
   "ahci"
@@ -143,7 +152,6 @@ boot.zfs.forceImportRoot = false;
 boot.zfs.enableUnstable = false;
 boot.zfs.requestEncryptionCredentials = [ hostName ];
 services.zfs.autoScrub.enable = true;
-environment.systemPackages = [ pkgs.zfs ];
 
 fileSystems."/" =
   { device = "${hostName}/root";