]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/oignon/hardware.nix
oignon: gobi_loader: setup
[julm/julm-nix.git] / hosts / oignon / hardware.nix
1 { config, lib, pkgs, hostName, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/acpid.nix
5 ../../nixos/profiles/hardware/thinkpad.nix
6 ../../nixos/profiles/zfs.nix
7 ../../nixos/profiles/zramSwap.nix
8 ];
9
10 /*
11 boot.loader.efi = {
12 canTouchEfiVariables = true;
13 efiSysMountPoint = "/boot/efi";
14 };
15 */
16 boot.loader.grub = {
17 enable = true;
18 version = 2;
19 device = "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_128GB_S1SMNSAFC36436X";
20 configurationLimit = 3;
21
22 #zfsSupport = true;
23 #efiSupport = true;
24 #enableCryptodisk = true;
25 };
26
27 services.udev.packages = [
28 pkgs.gobi_loader
29 ];
30
31 hardware.firmware = [
32 # https://www.thinkwiki.org/wiki/Qualcomm_Gobi_2000
33 (pkgs.runCommandNoCC "firmware-gobi" {} ''
34 mkdir -p $out/lib/firmware
35 # Fails due to forced compression https://github.com/NixOS/nixpkgs/issues/188542
36 ln -s /home/julm/documents/thinkpad-x201/gobi $out/lib/firmware/gobi
37 '')
38 ];
39
40 fileSystems."/boot" =
41 { device = "/dev/disk/by-partlabel/${hostName}_ssd_boot";
42 fsType = "ext2";
43 };
44 fileSystems."/boot/efi" =
45 { device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
46 fsType = "vfat";
47 };
48 swapDevices = [
49 { device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
50 randomEncryption = {
51 enable = true;
52 cipher = "aes-xts-plain64";
53 source = "/dev/urandom";
54 };
55 }
56 ];
57
58 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
59 # You should try to make this id unique among your hosts.
60 # Manually generated with : head -c4 /dev/urandom | od -A none -t x4 | cut -d ' ' -f 2
61 networking.hostId = "ce53d0c3";
62
63 boot.supportedFilesystems = [ "ntfs" "vfat" ];
64 boot.extraModulePackages = [
65 #config.boot.kernelPackages.exfat-nofuse
66 ];
67
68 powerManagement.powertop.enable = true;
69 #services.fprintd.enable = true;
70
71 fileSystems."/" =
72 { device = "${hostName}/root";
73 fsType = "zfs";
74 };
75 fileSystems."/nix" =
76 { device = "${hostName}/nix";
77 fsType = "zfs";
78 };
79 fileSystems."/var" =
80 { device = "${hostName}/var";
81 fsType = "zfs";
82 };
83
84 }