Skip to content

Commit 2b168ba

Browse files
committed
headscale: rename oidc.client_secret_file to oidc.client_secret_path
Headscale now supports passing the OIDC client secret via a file, as added in [juanfont/headscale#1127][1127]. Lets use that. The headscale option is `client_secret_path`; let's make it consistent and rename the Nix option to this. Note that I wasn't able to do this: mkRenamedOptionModule [ ... "client_secret_file" ] [ ... "client_secret_path" ] I get such error: error: evaluation aborted with the following error message: 'cannot find attribute `services.headscale.settings.oidc.client_secret_file'' [1127]: juanfont/headscale#1127
1 parent e76b919 commit 2b168ba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

nixos/modules/services/networking/headscale.nix

+3-6
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ in {
291291
'';
292292
};
293293

294-
client_secret_file = mkOption {
294+
client_secret_path = mkOption {
295295
type = types.nullOr types.path;
296296
default = null;
297297
description = lib.mdDoc ''
298-
Path to OpenID Connect client secret file.
298+
Path to OpenID Connect client secret file. Expands environment variables in format ''${VAR}.
299299
'';
300300
};
301301

@@ -425,7 +425,7 @@ in {
425425
(mkRenamedOptionModule ["services" "headscale" "dns" "baseDomain"] ["services" "headscale" "settings" "dns_config" "base_domain"])
426426
(mkRenamedOptionModule ["services" "headscale" "openIdConnect" "issuer"] ["services" "headscale" "settings" "oidc" "issuer"])
427427
(mkRenamedOptionModule ["services" "headscale" "openIdConnect" "clientId"] ["services" "headscale" "settings" "oidc" "client_id"])
428-
(mkRenamedOptionModule ["services" "headscale" "openIdConnect" "clientSecretFile"] ["services" "headscale" "settings" "oidc" "client_secret_file"])
428+
(mkRenamedOptionModule ["services" "headscale" "openIdConnect" "clientSecretFile"] ["services" "headscale" "settings" "oidc" "client_secret_path"])
429429
(mkRenamedOptionModule ["services" "headscale" "tls" "letsencrypt" "hostname"] ["services" "headscale" "settings" "tls_letsencrypt_hostname"])
430430
(mkRenamedOptionModule ["services" "headscale" "tls" "letsencrypt" "challengeType"] ["services" "headscale" "settings" "tls_letsencrypt_challenge_type"])
431431
(mkRenamedOptionModule ["services" "headscale" "tls" "letsencrypt" "httpListen"] ["services" "headscale" "settings" "tls_letsencrypt_listen"])
@@ -478,9 +478,6 @@ in {
478478
export HEADSCALE_DB_PASS="$(head -n1 ${escapeShellArg cfg.settings.db_password_file})"
479479
''}
480480
481-
${optionalString (cfg.settings.oidc.client_secret_file != null) ''
482-
export HEADSCALE_OIDC_CLIENT_SECRET="$(head -n1 ${escapeShellArg cfg.settings.oidc.client_secret_file})"
483-
''}
484481
exec ${cfg.package}/bin/headscale serve
485482
'';
486483

0 commit comments

Comments
 (0)