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