about summary refs log tree commit diff
path: root/sys/x220.nix
blob: 0eaacd52861784bc3d3351448f444485b7e3212e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{ pkgs, ... }:

{
  imports = [
    ../modules/nixos-hardware/lenovo/thinkpad/x220
    ../modules/workstation/physical
  ];

  hardware.enableRedistributableFirmware = true;

  boot.initrd.availableKernelModules =
    [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" "i915" ];

  boot.kernelModules = [ "kvm-intel" ];

  boot.loader.grub.enable = false;
  boot.loader.generic-extlinux-compatible.enable = true;

  boot.initrd.postDeviceCommands = ''
    mkdir /mnt
    mount /dev/mapper/root /mnt
    btrfs subvolume delete /mnt/boot
    btrfs subvolume create /mnt/boot
    umount /mnt
  '';

  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/c28ed0c0-4fa9-4d8a-a771-5fddac61adda";

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=boot" ];
  };

  fileSystems."/home" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/home" ];
  };

  fileSystems."/nix" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=persist/local/nix" ];
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/6F69-3310";
    fsType = "vfat";
  };

  fileSystems."/persist" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=persist" ];
  };

  fileSystems."/srv" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/srv" ];
  };

  fileSystems."/var/lib/machines" = {
    device = "/dev/disk/by-uuid/c068093d-512b-43d3-a4c3-cab52a190bfd";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/var/lib/machines" ];
  };

  networking.hostName = "x220";

  system.stateVersion = "22.05";

  users.users.qyliss.hashedPassword = "$5$rounds=1000000$tySRQ3rdqbPOduux$NcW7CoffEScpmOyS0Ga9gE5ZNLt8PT6.2Gvwn91vQn7";

  hardware.opengl.enable = true;
  hardware.opengl.extraPackages = with pkgs; [ libGL ];
}