nebula: enable service
[sourcephile-nix.git] / nixos / profiles / hardware / dl10j.nix
index 965a5dc9f5ac901793bd4b7c3f23ea6af250969d..67aa5e1ab45a0aa060a615933bbc822fc1103f06 100644 (file)
 { pkgs, lib, config, ... }:
 {
-nixpkgs.hostPlatform = {
-  system = "x86_64-linux";
-  config = "x86_64-unknown-linux-gnu";
-};
-_module.args.CPUs = 2;
-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
-  ];
-};
+  nixpkgs.hostPlatform = {
+    system = "x86_64-linux";
+    config = "x86_64-unknown-linux-gnu";
+  };
+  _module.args.CPUs = 2;
+  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
+    ];
+  };
 
-# Too CPU hungry for this hardware, for too little Mio saved
-nix.settings.auto-optimise-store = false;
+  # Too CPU hungry for this hardware, for too little Mio saved
+  nix.settings.auto-optimise-store = false;
 
-powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
+  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 
-# https://insanity.industries/post/sata-power-consumption/
-services.udev.extraRules = ''
-  SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="med_power_with_dipm"
-'';
+  # 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 = {
-  efi = {
-    canTouchEfiVariables = false;
-    efiSysMountPoint = "/boot/efi";
-  };
-  grub = {
-    enable = true;
-    version = 2;
-    copyKernels = true;
-    configurationLimit = 9;
-    efiSupport = true;
-    # Because canTouchEfiVariables doesn't work on this system
-    efiInstallAsRemovable = true;
-    devices = [
-      # Completed in the importing configuration
-    ];
-    /*
-    mirroredBoots = [
+  boot.loader = {
+    efi = {
+      canTouchEfiVariables = false;
+      efiSysMountPoint = "/boot/efi";
+    };
+    grub = {
+      enable = true;
+      copyKernels = true;
+      configurationLimit = 9;
+      efiSupport = true;
+      # Because canTouchEfiVariables doesn't work on this system
+      efiInstallAsRemovable = true;
+      devices = [
+        # Completed in the importing configuration
+      ];
+      /*
+        mirroredBoots = [
       { devices = [ "${disk_id}" ];
         path    = "/boot${bootnum}";
       }
-    ];
-    */
+        ];
+      */
+    };
   };
-};
 
-boot.initrd = {
-  availableKernelModules = [
-    "ahci"
-    "ehci_pci" # useless ?
-    "i2c_i801" # SMBus
-    "mei_me" # Communication controller
-    "nvme" # NVME M.2 disk
-    #"rtl8188ee" # Wireless
-    "rtsx_usb_sdmmc" # SD card
-    #"snd_hda_intel" # Audio
-    "uas" # USB storage
-    "xhci_hcd" # USB
-    #"i915" # VGA
-    "igb" # Ethernet
-    # Make the AES modules available at initrd,
-    # to speedup the deciphering of the root.
-    #"aes_x86_64"
-    "aesni_intel"
-    "cryptd"
-  ];
-  kernelModules = [
-    "igb" # Ethernet
-    "nvme" # NVME M.2 disk
+  boot.initrd = {
+    availableKernelModules = [
+      "ahci"
+      "ehci_pci" # useless ?
+      "i2c_i801" # SMBus
+      "mei_me" # Communication controller
+      "nvme" # NVME M.2 disk
+      #"rtl8188ee" # Wireless
+      "rtsx_usb_sdmmc" # SD card
+      #"snd_hda_intel" # Audio
+      "uas" # USB storage
+      "xhci_hcd" # USB
+      #"i915" # VGA
+      "igb" # Ethernet
+      # Make the AES modules available at initrd,
+      # to speedup the deciphering of the root.
+      #"aes_x86_64"
+      "aesni_intel"
+      "cryptd"
+    ];
+    kernelModules = [
+      "igb" # Ethernet
+      "nvme" # NVME M.2 disk
+      "rtsx_usb_sdmmc" # SD card
+      "ums_realtek" # SD card
+    ];
+  };
+  boot.kernelModules = [
     "rtsx_usb_sdmmc" # SD card
     "ums_realtek" # SD card
   ];
-};
-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"
-];
+  boot.extraModulePackages = [ ];
+  boot.kernelParams = [
+    "gfxpayload=text"
+    "console=ttyS0,115200n8"
+    "console=ttyS1,115200n8"
+    "console=tty0"
+  ];
 
-# rtlwifi/rtl8188efw.bin
-hardware.enableRedistributableFirmware = true;
+  # rtlwifi/rtl8188efw.bin
+  hardware.enableRedistributableFirmware = true;
 
-environment.systemPackages = with pkgs; [
-  pciutils
-  nvme-cli
-];
+  environment.systemPackages = with pkgs; [
+    pciutils
+    nvme-cli
+  ];
 }