about summary refs log tree commit diff
path: root/sys/mbp.nix
blob: e05e7dd30b15045f9cd791a6212fea30b62f5427 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ lib, pkgs, ... }:

{
  imports = [
    ../modules/nixos-apple-silicon/apple-silicon-support
    ../modules/persistence
    ../modules/workstation/audio
    ../modules/workstation/hardware/bluetooth
    ../modules/workstation/physical
  ];

  nixpkgs.hostPlatform.system = "aarch64-linux";

  hardware.enableRedistributableFirmware = true;

  boot.loader.systemd-boot.enable = true;

  boot.initrd.postDeviceCommands = ''
    mkdir /mnt
    mount /dev/mapper/root /mnt
    for subvol in var/tmp @ tmp; do
        btrfs subvolume delete "/mnt/$subvol"
        btrfs subvolume create "/mnt/$subvol"
    done
    umount /mnt
  '';

  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/dc106480-a643-4f32-a63d-931f53e8baae";

  boot.kernelPatches = [
    # Causes gnulib tests to fail.
    {
      name = "revert-asahi-libwebp-hack.patch";
      patch = pkgs.fetchpatch {
        url = "https://github.com/AsahiLinux/linux/commit/a5e95f77e7133c7e5f9c0999fae23ebf59d645d3.patch";
        revert = true;
        hash = "sha256-3Vl6SzGFt1+fCvYf9Gnw9XNudiixQHcbhPSRJ14bwhc=";
      };
    }

    {
      name = "drm-fix.patch";
      patch = pkgs.fetchurl {
        url = "https://lore.kernel.org/dri-devel/20231128090158.15564-1-tzimmermann@suse.de/raw";
        hash = "sha256-aNj6GpLt5nOv41cXkJTxXhF3LDIF0Z31j0jsQac64yM=";
      };
    }
  ];

  boot.kernelParams = [ "drm.debug=0x10" ];

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=@" ];
  };

  fileSystems."/tmp" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=tmp" ];
  };

  fileSystems."/var/tmp" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=var/tmp" ];
  };

  fileSystems."/home" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/home" ];
  };

  fileSystems."/nix" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist/local/nix" ];
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/472D-1D13";
    fsType = "vfat";
  };

  fileSystems."/persist" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist" ];
    neededForBoot = true;
  };

  fileSystems."/srv" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/srv" ];
  };

  fileSystems."/var/lib/machines" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/var/lib/machines" ];
  };

  fileSystems."/var/lib/portables" = {
    device = "/dev/disk/by-uuid/e5821c99-7507-421d-9280-de09a055d926";
    fsType = "btrfs";
    options = [ "subvol=persist/safe/var/lib/portables" ];
  };

  networking.hostName = "mbp";

  users.users.qyliss.hashedPassword = "$y$j9T$qdvgrHPyvZpqjUQXuagxD1$dq5yygUTVhVqpgG9.zWaihmtED437Cl.fllqJBEWSo4";

  hardware.opengl.enable = false;

  services.xserver.xkbOptions = "compose:ralt";

  programs.sway.extraConfig = ''
    output Unknown-1 scale 2
  '';

  system.stateVersion = "23.11";
}