aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/selfhost/headscale.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-01-09 20:36:36 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-01-09 20:36:36 -0600
commit547d6dc4731b04a240048b0b95c0ea12e0d1f6bd (patch)
treedd3d63dfb21c62d2d71a1f8e937d3247c2e78b11 /modules/services/nixos/selfhost/headscale.nix
parent7b9a5eb561948521ac4669074cc746a0f848ed23 (diff)
lots of changes, including revamp of network services boot chain on mercury
Diffstat (limited to 'modules/services/nixos/selfhost/headscale.nix')
-rw-r--r--modules/services/nixos/selfhost/headscale.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/modules/services/nixos/selfhost/headscale.nix b/modules/services/nixos/selfhost/headscale.nix
index 9319691..9989742 100644
--- a/modules/services/nixos/selfhost/headscale.nix
+++ b/modules/services/nixos/selfhost/headscale.nix
@@ -7,12 +7,14 @@
cfg = config.collinux.services.selfhost.headscale;
acl_file = (pkgs.formats.json {}).generate "acl.json" {
- ssh = {
- src = ["*"];
- dst = ["*"];
- users = ["autogroup:nonroot" "root"];
- action = "accept";
- };
+ ssh = [
+ {
+ src = ["collin@"];
+ dst = ["collin@"];
+ users = ["autogroup:nonroot" "root"];
+ action = "accept";
+ }
+ ];
};
in
lib.mkIf cfg.enable {
@@ -47,6 +49,17 @@ in
};
};
+ # make sure headscale can start before tailscale
+ systemd.services."headscale" = lib.mkIf config.collinux.services.networking.tailscale.enable {
+ after = lib.mkForce ["network.target"];
+ before = lib.mkForce ["headscale.target"];
+ wants = lib.mkForce ["network.target" "headscale.target"];
+ };
+
+ systemd.targets."headscale" = {
+ description = "Target represents headscale is running. started by headscale.service";
+ };
+
services.caddy.virtualHosts.${cfg.root_url}.extraConfig = lib.mkIf config.collinux.services.selfhost.caddy.enable ''
reverse_proxy localhost:8080
'';