Stop losing tsnet state on redeploys

This commit is contained in:
bluepython508
2024-11-01 18:06:24 +00:00
parent 5cdfab398d
commit f0641ffd6e
2 changed files with 2 additions and 1 deletions

View File

@@ -87,6 +87,7 @@
serviceConfig = {
DynamicUser = true;
RuntimeDirectory = name;
StateDirectory = name;
ExecStartPre = "!${pkgs.writeShellScript "get-authkey" ''
set -e
TS_API_CLIENT_ID=${cfg.clientId} TS_API_CLIENT_SECRET=$(cat ${cfg.clientSecretFile}) ${self.packages.${pkgs.system}.get-authkey}/bin/get-authkey -ephemeral -tags ${lib.concatStringsSep "," cfg.tags} > $RUNTIME_DIRECTORY/authkey