]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/oignon/hardware.nix
creds: change machine-id
[julm/julm-nix.git] / hosts / oignon / hardware.nix
1 { config, lib, 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.text = "46e396e54c264a3594d21de5c519dccf";
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 version = 2;
28 devices = [
29 "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_128GB_S1SMNSAFC36436X"
30 ];
31 configurationLimit = 16;
32
33 #zfsSupport = true;
34 #efiSupport = true;
35 #enableCryptodisk = true;
36 };
37
38 services.udev.extraRules = ''
39 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"
40 '';
41
42 fileSystems."/boot" =
43 { device = "/dev/disk/by-partlabel/${hostName}_ssd_boot";
44 fsType = "ext2";
45 };
46 fileSystems."/boot/efi" =
47 { device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
48 fsType = "vfat";
49 };
50 swapDevices = [
51 { device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
52 randomEncryption = {
53 enable = true;
54 cipher = "aes-xts-plain64";
55 source = "/dev/urandom";
56 };
57 }
58 ];
59
60 boot.supportedFilesystems = [ "ntfs" "vfat" ];
61
62 fileSystems."/" =
63 { device = "${hostName}/root";
64 fsType = "zfs";
65 };
66 fileSystems."/nix" =
67 { device = "${hostName}/nix";
68 fsType = "zfs";
69 };
70 fileSystems."/var" =
71 { device = "${hostName}/var";
72 fsType = "zfs";
73 };
74
75 }