aboutsummaryrefslogtreecommitdiff
path: root/nixos/configurations/binky.nix
blob: 4b552d5a499e3559ce865da5379d91f9497afa37 (plain)
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
{lib, ...}: let
  inherit (lib) mkDefault;
in {
  nixpkgs.hostPlatform.system = "x86_64-linux";
  deploy = {
    enable = true;
    default = false;
    ssh.host = "binky.spt";
  };

  cynerd = {
    desktop = {
      enable = true;
      laptop = true;
    };
    wifiClient = true;
    develop = true;
    wireguard = true;
    openvpn.elektroline = true;
  };

  boot = {
    initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
    kernelModules = ["kvm-amd"];
  };

  hardware.cpu.amd.updateMicrocode = true;

  boot.initrd.luks.devices = {
    "encroot".device = "/dev/disk/by-uuid/b317feb5-d68d-4ec3-a24f-0307c116cac8";
  };
  fileSystems = {
    "/" = {
      device = "/dev/mapper/encroot";
      fsType = "btrfs";
      options = ["compress=lzo" "subvol=@"];
    };
    "/nix" = {
      device = "/dev/mapper/encroot";
      fsType = "btrfs";
      options = ["compress=lzo" "subvol=@nix"];
    };
    "/home" = {
      device = "/dev/mapper/encroot";
      fsType = "btrfs";
      options = ["compress=lzo" "subvol=@home"];
    };
    "/boot" = {
      device = "/dev/disk/by-uuid/8F7D-A154";
      fsType = "vfat";
    };
  };
  services.btrfs.autoScrub = {
    enable = true;
    fileSystems = ["/"];
  };

  networking = {
    useNetworkd = true;
    useDHCP = false;
  };
  systemd.network = {
    networks = {
      "dhcp" = {
        matchConfig.Name = "enp2s0f0 enp5s0f3u1u1";
        networkConfig = {
          DHCP = "yes";
          IPv6AcceptRA = "yes";
        };
        linkConfig.RequiredForOnline = "routable";
      };
      "dhcp-wlan" = {
        matchConfig.Name = "wlp3s0";
        networkConfig = {
          DHCP = "yes";
          IPv6AcceptRA = "yes";
        };
        routes = [{Metric = 1088;}];
        linkConfig.RequiredForOnline = "routable";
      };
    };
    wait-online.enable = false;
  };

  services.syncthing = {
    enable = true;
    user = mkDefault "cynerd";
    group = mkDefault "cynerd";
    openDefaultPorts = true;

    overrideDevices = false;
    overrideFolders = false;

    dataDir = "/home/cynerd";
    configDir = "/home/cynerd/.config/syncthing";
  };
}