sourcehut: only enable Docker when needed
[sourcephile-nix.git] / nixos / profiles / hardware / apu2e4.nix
index 97d2bce90d3f052858229057c8b996a773f4c90f..a9e3073d4726c8b1f32c9eb4d837f80baff9ecf7 100644 (file)
@@ -1,19 +1,17 @@
-{ pkgs, lib, config, ... }:
+{ pkgs, lib, config, host, ... }:
 {
 hardware.cpu.amd.updateMicrocode = true;
 nix = {
   # Too CPU hungry for the APU2, for too little Mio saved
   autoOptimiseStore = false;
-  maxJobs = 4;
+  maxJobs = host.CPUs / 2;
 };
 powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 
-boot.kernel = {
-  sysctl = {
-    "vm.swappiness" = 10;
-    "vm.vfs_cache_pressure" = 50;
-  };
-};
+# 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 = {
@@ -52,9 +50,9 @@ boot.initrd = {
     "uas"
     # Ethernet driver
     "igb"
-    # 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"
   ];
@@ -68,7 +66,7 @@ boot.kernelParams = [
   #"console=tty0"
   "console=ttyS0,115200n8"
   # Use arc_summary to print stats
-  "zfs.zfs_arc_max=${toString (500 * 1024 * 1024)}" # bytes
+  #"zfs.zfs_arc_max=${toString (500 * 1024 * 1024)}" # bytes
 ];
 
 environment.systemPackages = [