tsuki: add headscale

This commit is contained in:
Oystein Kristoffer Tveit 2023-01-16 17:16:07 +01:00
parent c2f8fa0efb
commit 47d8aa7899
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
3 changed files with 54 additions and 1 deletions

View File

@ -7,6 +7,7 @@
# ./services/calibre.nix
./services/gitea
./services/grafana
./services/headscale.nix
./services/hydra.nix
# ./services/jitsi.nix
./services/jupyter.nix

View File

@ -0,0 +1,52 @@
{ pkgs, secrets, config, ... }:
{
services.headscale = {
enable = true;
# TODO: make PR
# dataDir = "${config.machineVars.dataDrives.default}/var/headscale";
serverUrl = "https://vpn.nani.wtf";
port = secrets.ports.headscale;
database = {
type = "postgres";
user = "headscale";
name = "headscale";
host = "localhost";
port = secrets.ports.postgres;
passwordFile = "${config.machineVars.dataDrives.default}/keys/postgres/headscale";
};
dns = {
magicDns = true;
nameservers = [
"1.1.1.1"
];
};
settings = {
log.level = "warn";
ip_prefixes = [ "10.8.0.0/24" ];
};
};
services.postgresql = {
enable = true;
ensureDatabases = [ "headscale" ];
ensureUsers = [
(rec {
name = "headscale";
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
})
];
};
environment.systemPackages = with pkgs; [ headscale ];
services.tailscale.enable = true;
networking.firewall.checkReversePath = "loose";
}

View File

@ -109,7 +109,7 @@
})
(proxy ["dyn"] "http://localhost:${s ports.minecraft.dynmap}" {})
(proxy ["osu"] "http://localhost:${s ports.osuchan}" {})
# (host ["vpn"] "" {})
(proxy ["vpn"] "http://localhost:${s ports.headscale}" {})
(proxy ["hydra"] "http://localhost:${s ports.hydra}" {})
] ++ (let
stickerpickers = pkgs.callPackage ../matrix/maunium-stickerpicker.nix {