blob: 11e6f04bb298a1de0bb7057db221d712a5d8e9ed [file] [log] [blame]
Skyler Greyf08a6192024-06-01 23:55:20 +00001# SPDX-FileCopyrightText: 2024 Auxolotl Infrastructure Contributors
2# SPDX-FileCopyrightText: 2024 Clicks Codes
3#
4# SPDX-License-Identifier: GPL-3.0-only
5
Skyler Grey61f0f852024-06-09 00:02:53 +00006{
7 pkgs,
8 modulesPath,
9 lib,
10 config,
11 ...
12}:
Skyler Greyf08a6192024-06-01 23:55:20 +000013{
14 boot.loader.systemd-boot.enable = true;
15 boot.loader.efi.canTouchEfiVariables = true;
16
17 time.timeZone = "Etc/UTC";
18
19 environment.systemPackages = with pkgs; [ neovim ];
20
21 clicks = {
22 nix.enable = true;
23
24 security = {
25 doas.enable = true;
26
27 acme = {
28 enable = true;
29 email = "minion@clicks.codes";
30 };
31 };
32
33 services = {
34 ssh.enable = true;
Skyler Grey61f0f852024-06-09 00:02:53 +000035 headscale = {
36 enable = true;
37 url = "clicks.domains";
38 oidc = {
39 enable = true;
40 issuer = "https://login.clicks.codes/realms/master";
41 allowed_groups = [ "/clicks" ];
42 client_secret_path =
43 config.clicks.secrets."${lib.clicks.secrets.name ./headscale.sops.json}".paths.oidc_client_secret;
44 };
45 database_password_path =
46 config.clicks.secrets."${lib.clicks.secrets.name ./headscale.sops.json}".paths.database_password;
47 noise_private_key_path =
48 config.clicks.secrets."${lib.clicks.secrets.name ./headscale.sops.json}".paths.noise_private_key;
49 private_key_path =
50 config.clicks.secrets."${lib.clicks.secrets.name ./headscale.sops.json}".paths.private_key;
51 };
Skyler Greyf08a6192024-06-01 23:55:20 +000052 };
Skyler Grey40ae7a02024-06-06 21:22:25 +000053
54 storage = {
Skyler Greyf4d05f02024-06-06 21:25:39 +000055 raid.enable = true;
Skyler Grey40ae7a02024-06-06 21:22:25 +000056 impermanence = {
57 enable = true;
Skyler Greyd3377402024-06-06 22:01:26 +000058 devices = {
59 root = "/dev/disk/by-uuid/ab5c2f52-a737-4b29-a505-e3d0b9d0714c";
60 persist = "/dev/md/a1d1:persist";
61 };
Skyler Grey40ae7a02024-06-06 21:22:25 +000062 };
63 };
Skyler Greyf08a6192024-06-01 23:55:20 +000064 };
65
66 boot.initrd.availableKernelModules = [
67 "nvme"
68 "xhci_pci"
69 "ahci"
70 "usbhid"
71 "uas"
72 "usb_storage"
73 "sd_mod"
74 ];
75 boot.initrd.kernelModules = [ ];
76 boot.kernelModules = [ "kvm-amd" ];
77 boot.extraModulePackages = [ ];
78
Skyler Grey40ae7a02024-06-06 21:22:25 +000079 fileSystems."/nix" = {
Skyler Greyf08a6192024-06-01 23:55:20 +000080 device = "/dev/disk/by-uuid/ab5c2f52-a737-4b29-a505-e3d0b9d0714c";
81 fsType = "btrfs";
Skyler Grey40ae7a02024-06-06 21:22:25 +000082 options = [ "subvol=@nix" ];
Skyler Greyf08a6192024-06-01 23:55:20 +000083 };
84
85 fileSystems."/boot" = {
86 device = "/dev/disk/by-uuid/880D-BBAB";
87 fsType = "vfat";
88 options = [
89 "fmask=0022"
90 "dmask=0022"
91 ];
92 };
93
94 swapDevices = [ ];
95
96 networking.useDHCP = true;
97
98 system.stateVersion = "24.05";
Skyler Grey61f0f852024-06-09 00:02:53 +000099
100 clicks.secrets."${lib.clicks.secrets.name ./headscale.sops.json}" = {
101 file = ./headscale.sops.json;
102 group = "headscale";
103 keys = [
104 "oidc_client_secret"
105 "database_password"
106 "noise_private_key"
107 "private_key"
108 ];
109 neededForUsers = false;
110 };
Skyler Greyf08a6192024-06-01 23:55:20 +0000111}