Merge pull request #183360 from Sohalt/nixos/headscale

nixos/headscale: minor improvements
This commit is contained in:
Aaron Andersen 2022-07-30 15:02:37 +02:00 committed by GitHub
commit 2aecc7fdc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -429,12 +429,16 @@ in
wantedBy = [ "multi-user.target" ];
restartTriggers = [ configFile ];
environment.GIN_MODE = "release";
script = ''
${optionalString (cfg.database.passwordFile != null) ''
export HEADSCALE_DB_PASS="$(head -n1 ${escapeShellArg cfg.database.passwordFile})"
''}
export HEADSCALE_OIDC_CLIENT_SECRET="$(head -n1 ${escapeShellArg cfg.openIdConnect.clientSecretFile})"
${optionalString (cfg.openIdConnect.clientSecretFile != null) ''
export HEADSCALE_OIDC_CLIENT_SECRET="$(head -n1 ${escapeShellArg cfg.openIdConnect.clientSecretFile})"
''}
exec ${cfg.package}/bin/headscale serve
'';