]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/oignon/hardware.nix
+user/perf(zswap): use zswap instead zramSwap
[julm/julm-nix.git] / hosts / oignon / hardware.nix
1 { pkgs, hostName, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/hardware/X201.nix
5 ../../nixos/profiles/zfs.nix
6 ];
7
8 # Setting the machine-id avoids to reencrypt all credentials
9 # when reinstalling NixOS on a new drive.
10 # Manually generated with : uuidgen | tr -d -
11 environment.etc.machine-id.source = ./machine-id.clear;
12
13 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
14 # You should try to make this id unique among your hosts.
15 # Manually generated with : uuidgen | head -c8
16 networking.hostId = "ce53d0c3";
17
18 /*
19 boot.loader.efi = {
20 canTouchEfiVariables = true;
21 efiSysMountPoint = "/boot/efi";
22 };
23 */
24 boot.loader.grub = {
25 enable = true;
26 memtest86.enable = true;
27 devices = [
28 "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_128GB_S1SMNSAFC36436X"
29 ];
30 configurationLimit = 16;
31
32 #zfsSupport = true;
33 #efiSupport = true;
34 #enableCryptodisk = true;
35 };
36 boot.zfs.requestEncryptionCredentials = [ hostName ];
37
38 hardware.enableRedistributableFirmware = true;
39
40 # Note that gobi_loader -2000 has to be rerun if the SIM is hot swapped
41 services.udev.extraRules = ''
42 ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyUSB*", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9204", RUN+="${pkgs.gobi_loader}/lib/udev/gobi_loader -2000 $env{DEVNAME} /home/julm/files/thinkpad-x201/gobi"
43 '';
44
45 fileSystems."/boot" = {
46 device = "/dev/disk/by-partlabel/${hostName}_ssd_boot";
47 fsType = "ext2";
48 };
49 fileSystems."/boot/efi" = {
50 device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
51 fsType = "vfat";
52 };
53 swapDevices = [
54 {
55 device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
56 randomEncryption = {
57 enable = true;
58 cipher = "aes-xts-plain64";
59 source = "/dev/urandom";
60 };
61 }
62 ];
63
64 boot.supportedFilesystems = [
65 "ntfs"
66 "vfat"
67 ];
68
69 fileSystems."/" = {
70 device = "${hostName}/root";
71 fsType = "zfs";
72 };
73 fileSystems."/nix" = {
74 device = "${hostName}/nix";
75 fsType = "zfs";
76 };
77 fileSystems."/var" = {
78 device = "${hostName}/var";
79 fsType = "zfs";
80 };
81
82 services.pipewire.jack.enable = true;
83
84 services.acpid = {
85 # Suspending not work well on this old computer.
86 lidEventCommands = "";
87 };
88
89 }