]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/nan2gua1/hardware.nix
nan2gua1: init host
[julm/julm-nix.git] / hosts / nan2gua1 / hardware.nix
1 {
2 lib,
3 pkgs,
4 config,
5 hostName,
6 inputs,
7 ...
8 }:
9 {
10 imports = [
11 ../../nixos/profiles/hardware/T14sAMDGen1.nix
12 ../../nixos/profiles/zfs.nix
13 ../../nixos/profiles/zramSwap.nix
14 #./lanzaboote.nix
15 ];
16
17 # Setting the machine-id avoids to reencrypt all credentials
18 # when reinstalling NixOS on a new drive.
19 # Manually generated with : uuidgen | tr -d -
20 environment.etc.machine-id.source = ./machine-id.clear;
21
22 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
23 # You should try to make this id unique among your hosts.
24 networking.hostId = lib.readFile ./host-id.clear;
25
26 boot.kernelParams = [
27 #"boot.trace"
28 "boot.shell_on_fail"
29 #"boot.debug1"
30 ];
31
32 # Deprecated in nixos-24.11
33 #boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
34 boot.loader = {
35 efi = {
36 canTouchEfiVariables = true;
37 efiSysMountPoint = "/boot1";
38 };
39 systemd-boot = {
40 enable = true;
41 #editor = false;
42 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
43 configurationLimit = 6;
44 memtest86.enable = true;
45 /*
46 extraInstallCommands = ''
47 rm -rf /efiboot/efi2
48 cp -r /efiboot/efi1 /efiboot/efi2
49 '';
50 */
51 # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
52 #mirroredBoots = [ ];
53 };
54 };
55 boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
56
57 #console.keyMap = lib.mkForce "de";
58
59 hardware.enableRedistributableFirmware = true;
60
61 fileSystems."/boot1" = {
62 device = "/dev/disk/by-partlabel/${hostName}_disk1_boot";
63 fsType = "vfat";
64 options = [
65 "rw"
66 "noexec"
67 "nodev"
68 "nofail"
69 "X-mount.mkdir"
70 "iocharset=iso8859-1"
71 ];
72 };
73 swapDevices = [
74 {
75 device = "/dev/disk/by-partlabel/${hostName}_disk1_swap";
76 randomEncryption = {
77 enable = true;
78 cipher = "aes-xts-plain64";
79 source = "/dev/urandom";
80 };
81 }
82 ];
83
84 boot.supportedFilesystems = [
85 "ntfs"
86 "vfat"
87 ];
88
89 fileSystems."/" = {
90 device = "${hostName}/root";
91 fsType = "zfs";
92 options = [ "zfsutil" ];
93 };
94 fileSystems."/nix" = {
95 device = "${hostName}/root/nix";
96 fsType = "zfs";
97 options = [
98 "X-mount.mkdir"
99 "zfsutil"
100 ];
101 };
102 fileSystems."/var" = {
103 device = "${hostName}/root/var";
104 fsType = "zfs";
105 options = [
106 "X-mount.mkdir"
107 "zfsutil"
108 ];
109 };
110
111 services.pipewire.jack.enable = true;
112
113 services.acpid = {
114 };
115
116 services.auto-cpufreq = {
117 enable = true;
118 settings = {
119 battery = {
120 enable_thresholds = true;
121 start_threshold = 65;
122 stop_threshold = 80;
123 };
124 };
125 };
126
127 }