Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

76 lines
1.7 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
pkg-config,
libsecret,
testers,
docker-credential-helpers,
}:
buildGoModule rec {
pname = "docker-credential-helpers";
version = "0.9.4";
src = fetchFromGitHub {
owner = "docker";
repo = "docker-credential-helpers";
rev = "v${version}";
sha256 = "sha256-cDpo3hw0yP9QnFvlGUIpjfMzni57KNkY+S+SIYOKBKQ=";
};
vendorHash = null;
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libsecret ];
ldflags = [
"-s"
"-w"
"-X github.com/docker/docker-credential-helpers/credentials.Version=${version}"
];
buildPhase =
let
cmds =
if stdenv.hostPlatform.isDarwin then
[
"osxkeychain"
"pass"
]
else
[
"secretservice"
"pass"
];
in
''
for cmd in ${toString cmds}; do
go build -ldflags "${toString ldflags}" -trimpath -o bin/docker-credential-$cmd ./$cmd/cmd
done
'';
installPhase = ''
install -Dm755 -t $out/bin bin/docker-credential-*
'';
passthru.tests.version = testers.testVersion {
package = docker-credential-helpers;
command = "docker-credential-pass version";
};
meta =
with lib;
{
description = "Suite of programs to use native stores to keep Docker credentials safe";
homepage = "https://github.com/docker/docker-credential-helpers";
license = licenses.mit;
maintainers = [ ];
}
// lib.optionalAttrs stdenv.hostPlatform.isDarwin {
mainProgram = "docker-credential-osxkeychain";
};
}