44 lines
907 B
Nix
44 lines
907 B
Nix
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.modules.services.headscale;
|
|
in {
|
|
options.modules.services.headscale = {
|
|
enable = mkOption {
|
|
default = false;
|
|
example = true;
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.nginx.virtualHosts = {
|
|
"headscale.vimium.net" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:${toString config.services.headscale.port}";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
services.headscale = {
|
|
enable = true;
|
|
port = 8080;
|
|
settings = {
|
|
server_url = "https://headscale.vimium.net";
|
|
dns_config = {
|
|
base_domain = "vimium.net";
|
|
};
|
|
logtail.enabled = false;
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
config.services.headscale.package
|
|
];
|
|
};
|
|
}
|