50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.vps.remnawave;
|
|
domain = config.sops.placeholder."domain";
|
|
in
|
|
{
|
|
config = mkIf (cfg.enable && cfg.type == "panel") {
|
|
sops.secrets = {
|
|
"domain" = { };
|
|
"panel/tinyauth-users" = { };
|
|
};
|
|
|
|
sops.templates."tinyauth.env" = {
|
|
mode = "0400";
|
|
content = ''
|
|
TINYAUTH_PORT=3002
|
|
TINYAUTH_APP_URL=https://ta.${domain}
|
|
TINYAUTH_USERS=${config.sops.placeholder."panel/tinyauth-users"}
|
|
'';
|
|
};
|
|
|
|
virtualisation.oci-containers.containers.tinyauth = {
|
|
image = "ghcr.io/maposia/remnawave-tinyauth:v5";
|
|
autoStart = true;
|
|
environmentFiles = [ config.sops.templates."tinyauth.env".path ];
|
|
ports = [ "127.0.0.1:3002:3002" ];
|
|
volumes = [ "tinyauth-data:/data" ];
|
|
log-driver = "journald";
|
|
extraOptions = [
|
|
"--network=remnawave"
|
|
"--hostname=tinyauth"
|
|
];
|
|
};
|
|
|
|
systemd.services.docker-tinyauth = {
|
|
after = [
|
|
"docker-remnawave-network.service"
|
|
"sops-nix.service"
|
|
];
|
|
requires = [ "docker-remnawave-network.service" ];
|
|
wants = [ "sops-nix.service" ];
|
|
};
|
|
};
|
|
}
|