about summary refs log tree commit diff
path: root/users/tazjin/nixos/zamalek/default.nix
blob: d1ba771fad1ec56c7a3b8511d97428b44d65ff64 (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
# zamalek is my Huawei MateBook X (unknown year)
{ depot, lib, pkgs, ... }:

config:
let
  mod = name: depot.path + ("/ops/modules/" + name);
  usermod = name: depot.path + ("/users/tazjin/nixos/modules/" + name);

  zdevice = device: {
    inherit device;
    fsType = "zfs";
  };
in
{
  imports = [
    (usermod "desktop.nix")
    (usermod "fonts.nix")
    (usermod "hidpi.nix")
    (usermod "home-config.nix")
    (usermod "laptop.nix")
    (usermod "persistence.nix")
    (usermod "physical.nix")
    (usermod "zerotier.nix")

    (depot.third_party.impermanence + "/nixos.nix")
    (pkgs.home-manager.src + "/nixos")
  ];

  tvl.cache.enable = true;

  boot = {
    initrd.availableKernelModules = [ "nvme" "xhci_pci" ];
    loader.systemd-boot.enable = true;
    loader.efi.canTouchEfiVariables = true;
    supportedFilesystems = [ "zfs" ];
    zfs.devNodes = "/dev/";

    extraModprobeConfig = ''
      options snd_hda_intel power_save=1
      options iwlwifi power_save=1
      options iwldvm force_cam=0
      options i915 enable_guc=3 enable_fbc=1
    '';
  };

  fileSystems = {
    "/" = zdevice "zpool/ephemeral/root";
    "/home" = zdevice "zpool/ephemeral/home";
    "/persist" = zdevice "zpool/persistent/data" // { neededForBoot = true; };
    "/nix" = zdevice "zpool/persistent/nix";
    "/depot" = zdevice "zpool/persistent/depot";

    "/boot" = {
      device = "/dev/disk/by-uuid/2487-3908";
      fsType = "vfat";
    };
  };

  networking = {
    hostName = "zamalek";
    domain = "tvl.su";
    hostId = "ee399356";
    networkmanager.enable = true;

    nameservers = [
      "8.8.8.8"
      "8.8.4.4"
    ];
  };

  hardware = {
    cpu.intel.updateMicrocode = true;
    bluetooth.enable = true;
    enableRedistributableFirmware = true;
    opengl.enable = true;
  };

  system.stateVersion = "21.11";
}