[headscale] Add headscale
This commit is contained in:
27
lib/modules/headscale/default.nix
Normal file
27
lib/modules/headscale/default.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{config, pkgs, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
domain = "enclave.ctsk.dev";
|
||||||
|
port = 10020;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
services.headscale = {
|
||||||
|
address = "127.0.0.1";
|
||||||
|
port = port;
|
||||||
|
settings = {
|
||||||
|
server_url = "https://${domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
|
||||||
|
locations."/".proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.headscale ];
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ let
|
|||||||
ports = {
|
ports = {
|
||||||
ssh = [ 2322 2323 2324 ];
|
ssh = [ 2322 2323 2324 ];
|
||||||
gitea = 10010;
|
gitea = 10010;
|
||||||
|
headscale = 10020;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
@@ -13,12 +14,14 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
../../modules/gitea
|
../../modules/gitea
|
||||||
|
../../modules/headscale
|
||||||
../../users/christian
|
../../users/christian
|
||||||
];
|
];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
gitea.enable = true;
|
gitea.enable = true;
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
|
headscale.enable = true;
|
||||||
openssh = {
|
openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = ports.ssh;
|
ports = ports.ssh;
|
||||||
|
|||||||
Reference in New Issue
Block a user