mermet: calibre: fix ExecStart=
[sourcephile-nix.git] / nixos / profiles / hardware / apu2e4.nix
index 1a1c62c5c4f5919e1a599702f0df3eaa71a4c1ba..4860cede5d94b4422d8d64bb92dc37a8199ae250 100644 (file)
@@ -1,77 +1,82 @@
 { pkgs, lib, config, ... }:
 {
-hardware.cpu.amd.updateMicrocode = true;
 
-# Too CPU hungry for this hardware, for too little Mio saved
-nix.settings.auto-optimise-store = false;
+  nixpkgs.hostPlatform = {
+    system = "x86_64-linux";
+    config = "x86_64-unknown-linux-gnu";
+  };
+  _module.args.CPUs = 4;
+  hardware.cpu.amd.updateMicrocode = true;
 
-powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
+  # Too CPU hungry for this hardware, for too little Mio saved
+  nix.settings.auto-optimise-store = false;
 
-# https://insanity.industries/post/sata-power-consumption/
-services.udev.extraRules = ''
-  SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="med_power_with_dipm"
-'';
+  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 
-boot.loader = {
-  grub = {
-    enable = true;
-    version = 2;
-    copyKernels = true;
-    configurationLimit = 1;
-    # efiSupport = true;
-    # In case canTouchEfiVariables doesn't work
-    #efiInstallAsRemovable = true;
-    devices = [
-      # Completed in the importing configuration
-    ];
-    /*
-    mirroredBoots = [
+  # 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;
+      copyKernels = true;
+      configurationLimit = 1;
+      # efiSupport = true;
+      # In case canTouchEfiVariables doesn't work
+      #efiInstallAsRemovable = true;
+      devices = [
+        # Completed in the importing configuration
+      ];
+      /*
+        mirroredBoots = [
       { devices = [ "${disk_id}" ];
         path    = "/boot${bootnum}";
       }
-    ];
+        ];
+      */
+    };
+    /*
+      efi = {
+      canTouchEfiVariables = true;
+      efiSysMountPoint = "/boot/efi";
+      };
     */
   };
-  /*
-  efi = {
-    canTouchEfiVariables = true;
-    efiSysMountPoint = "/boot/efi";
+
+  boot.initrd = {
+    availableKernelModules = [
+      "ahci"
+      "ehci_pci"
+      "sd_mod"
+      "sg"
+      "uas"
+      # Ethernet driver
+      "igb"
+      # Make the AES modules available at initrd,
+      # to speedup the deciphering of the root.
+      #"aes_x86_64"
+      "aesni_intel"
+      "cryptd"
+    ];
+    kernelModules = [
+      "igb"
+      # Enable boot from SD card
+      "sdhci_pci"
+    ];
   };
-  */
-};
 
-boot.initrd = {
-  availableKernelModules = [
-    "ahci"
-    "ehci_pci"
-    "sd_mod"
-    "sg"
-    "uas"
-    # Ethernet driver
-    "igb"
-    # Make the AES modules available at initrd,
-    # to speedup the deciphering of the root.
-    #"aes_x86_64"
-    "aesni_intel"
-    "cryptd"
+  boot.kernelParams = [
+    "gfxpayload=text"
+    #"console=tty0"
+    "console=ttyS0,115200n8"
+    # Avoids huge slow downs, especially with postgresql.
+    "zfs.zfs_arc_max=${toString (1024 * 1024 * 1024)}" # bytes
   ];
-  kernelModules = [
-    "igb"
-    # Enable boot from SD card
-    "sdhci_pci"
-  ];
-};
-
-boot.kernelParams = [
-  "gfxpayload=text"
-  #"console=tty0"
-  "console=ttyS0,115200n8"
-  # Use arc_summary to print stats
-  #"zfs.zfs_arc_max=${toString (500 * 1024 * 1024)}" # bytes
-];
 
-environment.systemPackages = [
-  pkgs.pciutils
-  pkgs.flashrom
-];
+  environment.systemPackages = [
+    pkgs.pciutils
+    pkgs.flashrom
+  ];
 }