dex-oidc: Fix embedded version string, add test (#285104)

Followup to #283991
This commit is contained in:
Benjamin Staffin 2024-01-31 13:57:11 -05:00 committed by GitHub
parent 9e485b2169
commit 215701875d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, buildGoModule, fetchFromGitHub, nixosTests, testers, dex-oidc }:
buildGoModule rec {
pname = "dex";
@ -18,7 +18,7 @@ buildGoModule rec {
];
ldflags = [
"-w" "-s" "-X github.com/dexidp/dex/version.Version=${src.rev}"
"-w" "-s" "-X main.version=${src.rev}"
];
postInstall = ''
@ -26,7 +26,14 @@ buildGoModule rec {
cp -r $src/web $out/share/web
'';
passthru.tests = { inherit (nixosTests) dex-oidc; };
passthru.tests = {
inherit (nixosTests) dex-oidc;
version = testers.testVersion {
package = dex-oidc;
command = "dex version";
version = "v${version}";
};
};
meta = with lib; {
description = "OpenID Connect and OAuth2 identity provider with pluggable connectors";