NiksOS/system/server/coder.nix
2025-08-21 23:42:57 +02:00

37 lines
847 B
Nix

{
config,
lib,
pkgs,
...
}: let
inherit (config.niksos) server;
port = 9005;
host = "coder.jsw.tf";
sPort = builtins.toString port;
httpsHost = "https://" + host;
in {
config = lib.mkIf server {
services = {
caddy.virtualHosts."${host}".extraConfig = ''
reverse_proxy :${sPort}
'';
coder = {
enable = true;
listenAddress = "127.0.0.1:${sPort}";
wildcardAccessUrl = "*.${host}";
accessUrl = httpsHost;
environment = {
file = ./file.file; # See format below.
/*
CODER_OIDC_CLIENT_ID=""
CODER_OIDC_CLIENT_SECRET=""
*/
extra = {
CODER_OIDC_ISSUER_URL = "https://z.jsw.tf";
# CODER_OIDC_EMAIL_DOMAIN="your-domain-1,your-domain-2";
};
};
};
};
};
}