nixpkgs/pkgs/by-name/do/doppler/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.3 KiB
Nix
Raw Normal View History

{ buildGoModule
, doppler
, fetchFromGitHub
, installShellFiles
, lib
, testers
, stdenv
}:
2020-08-06 23:36:01 +00:00
buildGoModule rec {
pname = "doppler";
2024-11-19 02:01:22 +00:00
version = "3.69.2";
2020-08-06 23:36:01 +00:00
src = fetchFromGitHub {
owner = "dopplerhq";
repo = "cli";
rev = version;
2024-11-19 02:01:22 +00:00
hash = "sha256-65DKCmAzGEKbB/R9NlkTa2lBEcfX0iBXJQWH8OXfemc=";
2020-08-06 23:36:01 +00:00
};
2024-02-16 01:43:41 +00:00
vendorHash = "sha256-NUHWKPszQH/pvnA+j65+bJ6t+C0FDRRbTviqkYztpE4=";
2020-08-06 23:36:01 +00:00
ldflags = [
"-s -w"
"-X github.com/DopplerHQ/cli/pkg/version.ProgramVersion=v${version}"
];
nativeBuildInputs = [ installShellFiles ];
2020-08-06 23:36:01 +00:00
postInstall = ''
mv $out/bin/cli $out/bin/doppler
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export HOME=$TMPDIR
mkdir $HOME/.doppler # to avoid race conditions below
installShellCompletion --cmd doppler \
--bash <($out/bin/doppler completion bash) \
--fish <($out/bin/doppler completion fish) \
--zsh <($out/bin/doppler completion zsh)
2020-08-06 23:36:01 +00:00
'';
passthru.tests.version = testers.testVersion {
package = doppler;
version = "v${version}";
};
2020-08-06 23:36:01 +00:00
meta = with lib; {
description = "Official CLI for interacting with your Doppler Enclave secrets and configuration";
mainProgram = "doppler";
homepage = "https://doppler.com";
2020-08-06 23:36:01 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ lucperkins ];
};
}