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