]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/blackberry/hardware.nix
+user/perf(zswap): use zswap instead zramSwap
[julm/julm-nix.git] / hosts / blackberry / hardware.nix
1 { pkgs, hostName, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/hardware/E5500.nix
5 ../../nixos/profiles/zfs.nix
6 ];
7
8 boot.kernelParams = [
9 # Avoids huge slow downs, especially with nix.
10 "zfs.zfs_arc_max=${toString (1024 * 1024 * 1024)}" # bytes
11 ];
12
13 # Setting the machine-id avoids to reencrypt all credentials
14 # when reinstalling NixOS on a new drive.
15 # Manually generated with : uuidgen | tr -d -
16 environment.etc.machine-id.source = ./machine-id.clear;
17
18 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
19 # You should try to make this id unique among your hosts.
20 # Manually generated with : uuidgen | head -c8
21 networking.hostId = "e53001b7";
22
23 boot.loader = {
24 grub = {
25 enable = true;
26 memtest86.enable = true;
27 mirroredBoots = [
28 {
29 path = "/boot1";
30 devices = [ "/dev/disk/by-id/ata-CT250MX500SSD1_2004E2849DD5" ];
31 }
32 ];
33 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
34 configurationLimit = 6;
35
36 #zfsSupport = true;
37 #efiSupport = true;
38 #enableCryptodisk = true;
39 };
40 };
41 boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
42
43 hardware.enableRedistributableFirmware = true;
44
45 fileSystems."/boot1" = {
46 device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
47 fsType = "vfat";
48 options = [
49 "rw"
50 "noexec"
51 "nodev"
52 "nofail"
53 "X-mount.mkdir"
54 "iocharset=iso8859-1"
55 ];
56 };
57 swapDevices = [
58 {
59 device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
60 randomEncryption = {
61 enable = true;
62 cipher = "aes-xts-plain64";
63 source = "/dev/urandom";
64 };
65 }
66 ];
67
68 boot.supportedFilesystems = [
69 "ntfs"
70 "vfat"
71 ];
72
73 fileSystems."/" = {
74 device = "${hostName}/root";
75 fsType = "zfs";
76 options = [ "zfsutil" ];
77 };
78 fileSystems."/nix" = {
79 device = "${hostName}/root/nix";
80 fsType = "zfs";
81 options = [
82 "X-mount.mkdir"
83 "zfsutil"
84 ];
85 };
86 fileSystems."/var" = {
87 device = "${hostName}/root/var";
88 fsType = "zfs";
89 options = [
90 "X-mount.mkdir"
91 "zfsutil"
92 ];
93 };
94
95 services.pipewire.jack.enable = true;
96
97 environment.variables = {
98 # Workaround https://github.com/ghostty-org/ghostty/issues/2025#issuecomment-2563222225
99 #GDK_DEBUG = "gl-disable-gles";
100 LIBGL_ALWAYS_SOFTWARE = "true";
101 };
102 }