diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 12372c0a3a5874..e898d3da247dfd 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -558,6 +558,8 @@ - `nix.channel.enable = false` no longer implies `nix.settings.nix-path = []`. Since Nix 2.13, a `nix-path` set in `nix.conf` cannot be overriden by the `NIX_PATH` configuration variable. +- `services.dex` now restarts upon changes to the `.environmentFile` or entries in `.settings.staticClients[].secretFile` when the entry is a `path` type. + ## Detailed migration information {#sec-release-24.11-migration} ### `sound` options removal {#sec-release-24.11-migration-sound} diff --git a/nixos/modules/services/web-apps/dex.nix b/nixos/modules/services/web-apps/dex.nix index 7fbbd8a0c28491..d352d94e1ce856 100644 --- a/nixos/modules/services/web-apps/dex.nix +++ b/nixos/modules/services/web-apps/dex.nix @@ -16,6 +16,10 @@ let replace-secret '${file}' '${file}' /run/dex/config.yaml '') secretFiles)); + + restartTriggers = [] + ++ (optionals (cfg.environmentFile != null) [ cfg.environmentFile ]) + ++ (filter (file: builtins.typeOf file == "path") secretFiles); in { options.services.dex = { @@ -72,6 +76,7 @@ in wantedBy = [ "multi-user.target" ]; after = [ "networking.target" ] ++ (optional (cfg.settings.storage.type == "postgres") "postgresql.service"); path = with pkgs; [ replace-secret ]; + restartTriggers = restartTriggers; serviceConfig = { ExecStart = "${pkgs.dex-oidc}/bin/dex serve /run/dex/config.yaml"; ExecStartPre = [