summaryrefslogtreecommitdiff
path: root/config/hardware/default.nix
blob: 5b4f50f3d59ae94414839d4085061b46f1567a48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ nixos-hardware, modulesPath, ... }:

{
  imports = [
    (modulesPath + "/profiles/headless.nix")
    ./hardware-configuration.nix
    nixos-hardware.nixosModules.pcengines-apu
    nixos-hardware.nixosModules.common-pc-ssd
    nixos-hardware.nixosModules.common-cpu-amd
  ];

  personal.hardware = {
    usb.enable = true;
    firmwareNonFree.enable = true;
  };

  swapDevices = [{ device = "/swap"; }];

  # The CPU frequency should stay at the minimum until the router has
  # some load to compute.
  powerManagement.cpuFreqGovernor = "ondemand";
  services.acpid.enable = true;

  # The service irqbalance is useful as it assigns certain IRQ calls
  # to specific CPUs instead of letting the first CPU core to handle
  # everything. This is supposed to increase performance by hitting
  # CPU cache more often. 
  services.irqbalance.enable = true;

  # Re-enable the serial console, disabled by the headless profile
  systemd.services."serial-getty@ttyS0".enable = true;
}