public-inbox: fix coderepo paths
[sourcephile-nix.git] / nixos / profiles / hardware / dl10j.nix
index 32a374a10d737494a8257377c75e997be2a2eb93..c4b85f469b416e1ed699fcdd9dc22ecef542cc02 100644 (file)
@@ -1,26 +1,32 @@
-{ pkgs, lib, config, ... }:
+{ pkgs, lib, config, host, ... }:
 {
 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
+  ];
+};
 nix = {
   # Too CPU hungry for the DL10J, for too little Mio saved
   autoOptimiseStore = false;
-  maxJobs = 2;
+  maxJobs = host.CPUs;
 };
 powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 
-boot.kernel = {
-  sysctl = {
-    # Recommended to improve performance when RAM is sufficient.
-    "vm.swappiness" = lib.mkDefault 10;
-  };
-};
+# https://insanity.industries/post/sata-power-consumption/
+services.udev.extraRules = ''
+  SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="med_power_with_dipm"
+'';
 
 boot.loader = {
   grub = {
     enable = true;
     version = 2;
     copyKernels = true;
-    configurationLimit = 1;
+    configurationLimit = 9;
     efiSupport = true;
     # Because canTouchEfiVariables doesn't work on this system
     efiInstallAsRemovable = true;
@@ -55,9 +61,9 @@ boot.initrd = {
     "xhci_hcd" # USB
     #"i915" # VGA
     "igb" # Ethernet
-    # Made the AES modules available at initrd,
+    # Make the AES modules available at initrd,
     # to speedup the deciphering of the root.
-    "aes_x86_64"
+    #"aes_x86_64"
     "aesni_intel"
     "cryptd"
   ];
@@ -65,22 +71,26 @@ boot.initrd = {
     "igb" # Ethernet
     "nvme" # NVME M.2 disk
     "rtsx_usb_sdmmc" # SD card
+    "ums_realtek" # SD card
   ];
 };
-boot.kernelModules = [ ];
+boot.kernelModules = [
+  "rtsx_usb_sdmmc" # SD card
+  "ums_realtek" # SD card
+];
 boot.extraModulePackages = [ ];
 boot.kernelParams = [
   "gfxpayload=text"
   "console=ttyS0,115200n8"
   "console=ttyS1,115200n8"
   "console=tty0"
-  # Use arc_summary to print stats
-  "zfs.zfs_arc_max=${toString (1000 * 1024 * 1024)}" # bytes
 ];
 
+# rtlwifi/rtl8188efw.bin
+hardware.enableRedistributableFirmware = true;
+
 environment.systemPackages = with pkgs; [
   pciutils
-  #flashrom
   nvme-cli
 ];
 }