nixos/dex: add `package` option

authored by

Acid Bong and committed by
Masum Reza
89abf881 771d70fb

+4 -2
+4 -2
nixos/modules/services/web-apps/dex.nix
··· 47 47 options.services.dex = { 48 48 enable = mkEnableOption "the OpenID Connect and OAuth2 identity provider"; 49 49 50 + package = mkPackageOption pkgs "dex-oidc" { }; 51 + 50 52 environmentFile = mkOption { 51 53 type = types.nullOr types.path; 52 54 default = null; ··· 84 86 ''; 85 87 description = '' 86 88 The available options can be found in 87 - [the example configuration](https://github.com/dexidp/dex/blob/v${pkgs.dex-oidc.version}/config.yaml.dist). 89 + [the example configuration](https://github.com/dexidp/dex/blob/v${cfg.package.version}/config.yaml.dist). 88 90 89 91 It's also possible to refer to environment variables (defined in [services.dex.environmentFile](#opt-services.dex.environmentFile)) 90 92 using the syntax `$VARIABLE_NAME`. ··· 103 105 restartTriggers = restartTriggers; 104 106 serviceConfig = 105 107 { 106 - ExecStart = "${pkgs.dex-oidc}/bin/dex serve /run/dex/config.yaml"; 108 + ExecStart = "${cfg.package}/bin/dex serve /run/dex/config.yaml"; 107 109 ExecStartPre = [ 108 110 "${pkgs.coreutils}/bin/install -m 600 ${configFile} /run/dex/config.yaml" 109 111 "+${startPreScript}"