2024-11-17 12:17:45 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
stdenv,
|
|
|
|
vendorHash,
|
|
|
|
go,
|
|
|
|
}:
|
2020-07-06 07:30:09 +01:00
|
|
|
buildGoModule {
|
|
|
|
pname = "sops-install-secrets";
|
|
|
|
version = "0.0.1";
|
|
|
|
|
2024-11-17 12:17:45 +01:00
|
|
|
src = lib.sourceByRegex ../.. [
|
|
|
|
"go\.(mod|sum)"
|
|
|
|
"pkgs"
|
|
|
|
"pkgs/sops-install-secrets.*"
|
|
|
|
];
|
2020-07-06 07:30:09 +01:00
|
|
|
|
2020-07-12 13:50:55 +01:00
|
|
|
subPackages = [ "pkgs/sops-install-secrets" ];
|
|
|
|
|
2020-08-10 18:17:08 +01:00
|
|
|
# requires root privileges for tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-11-17 12:17:45 +01:00
|
|
|
outputs = [ "out" ] ++ lib.lists.optionals (stdenv.isLinux) [ "unittest" ];
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
go test -c ./pkgs/sops-install-secrets
|
|
|
|
''
|
|
|
|
+ lib.optionalString (stdenv.isLinux) ''
|
|
|
|
# *.test is only tested on linux. $unittest does not exist on darwin.
|
|
|
|
install -D ./sops-install-secrets.test $unittest/bin/sops-install-secrets.test
|
|
|
|
# newer versions of nixpkgs no longer require this step
|
|
|
|
if command -v remove-references-to; then
|
|
|
|
remove-references-to -t ${go} $unittest/bin/sops-install-secrets.test
|
|
|
|
fi
|
|
|
|
'';
|
2020-11-13 10:39:17 +01:00
|
|
|
|
2023-07-15 08:19:01 +02:00
|
|
|
inherit vendorHash;
|
2020-07-12 17:18:12 +01:00
|
|
|
|
2021-01-31 18:02:21 -08:00
|
|
|
meta = with lib; {
|
2020-07-12 17:18:12 +01:00
|
|
|
description = "Atomic secret provisioning based on sops";
|
|
|
|
homepage = "https://github.com/Mic92/sops-nix";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2022-07-10 13:12:14 +02:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-07-12 17:18:12 +01:00
|
|
|
};
|
2020-07-06 07:30:09 +01:00
|
|
|
}
|