]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/oignon/hardware.nix
git: install tig
[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 ../../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 = "ce53d0c3";
18
19 /*
20 boot.loader.efi = {
21 canTouchEfiVariables = true;
22 efiSysMountPoint = "/boot/efi";
23 };
24 */
25 boot.loader.grub = {
26 enable = true;
27 memtest86.enable = true;
28 version = 2;
29 devices = [
30 "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_128GB_S1SMNSAFC36436X"
31 ];
32 configurationLimit = 16;
33
34 #zfsSupport = true;
35 #efiSupport = true;
36 #enableCryptodisk = true;
37 };
38
39 # Note that gobi_loader -2000 has to be rerun if the SIM is hot swapped
40 services.udev.extraRules = ''
41 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/documents/thinkpad-x201/gobi"
42 '';
43
44 fileSystems."/boot" =
45 {
46 device = "/dev/disk/by-partlabel/${hostName}_ssd_boot";
47 fsType = "ext2";
48 };
49 fileSystems."/boot/efi" =
50 {
51 device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
52 fsType = "vfat";
53 };
54 swapDevices = [
55 {
56 device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
57 randomEncryption = {
58 enable = true;
59 cipher = "aes-xts-plain64";
60 source = "/dev/urandom";
61 };
62 }
63 ];
64
65 boot.supportedFilesystems = [ "ntfs" "vfat" ];
66
67 fileSystems."/" =
68 {
69 device = "${hostName}/root";
70 fsType = "zfs";
71 };
72 fileSystems."/nix" =
73 {
74 device = "${hostName}/nix";
75 fsType = "zfs";
76 };
77 fileSystems."/var" =
78 {
79 device = "${hostName}/var";
80 fsType = "zfs";
81 };
82
83 services.pipewire.jack.enable = true;
84
85 }