]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/profiles/hardware/apu2e4.nix
mermet: knot: change dnssec-policy to ed25519
[sourcephile-nix.git] / nixos / profiles / hardware / apu2e4.nix
1 { pkgs, lib, config, ... }:
2 {
3
4 nixpkgs.hostPlatform = {
5 system = "x86_64-linux";
6 config = "x86_64-unknown-linux-gnu";
7 };
8 _module.args.CPUs = 4;
9 hardware.cpu.amd.updateMicrocode = true;
10
11 # Too CPU hungry for this hardware, for too little Mio saved
12 nix.settings.auto-optimise-store = false;
13
14 powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
15
16 # https://insanity.industries/post/sata-power-consumption/
17 services.udev.extraRules = ''
18 SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="med_power_with_dipm"
19 '';
20
21 boot.loader = {
22 grub = {
23 enable = true;
24 copyKernels = true;
25 configurationLimit = 1;
26 # efiSupport = true;
27 # In case canTouchEfiVariables doesn't work
28 #efiInstallAsRemovable = true;
29 devices = [
30 # Completed in the importing configuration
31 ];
32 /*
33 mirroredBoots = [
34 { devices = [ "${disk_id}" ];
35 path = "/boot${bootnum}";
36 }
37 ];
38 */
39 };
40 /*
41 efi = {
42 canTouchEfiVariables = true;
43 efiSysMountPoint = "/boot/efi";
44 };
45 */
46 };
47
48 boot.initrd = {
49 availableKernelModules = [
50 "ahci"
51 "ehci_pci"
52 "sd_mod"
53 "sg"
54 "uas"
55 # Ethernet driver
56 "igb"
57 # Make the AES modules available at initrd,
58 # to speedup the deciphering of the root.
59 #"aes_x86_64"
60 "aesni_intel"
61 "cryptd"
62 ];
63 kernelModules = [
64 "igb"
65 # Enable boot from SD card
66 "sdhci_pci"
67 ];
68 };
69
70 boot.kernelParams = [
71 "gfxpayload=text"
72 #"console=tty0"
73 "console=ttyS0,115200n8"
74 # Avoids huge slow downs, especially with postgresql.
75 "zfs.zfs_arc_max=${toString (1024 * 1024 * 1024)}" # bytes
76 ];
77
78 environment.systemPackages = [
79 pkgs.pciutils
80 pkgs.flashrom
81 ];
82 }