2024-09-01 14:30:42 +00:00
|
|
|
{ lib, buildGoModule, stdenv, vendorHash, go, callPackages }:
|
2020-07-06 06:30:09 +00:00
|
|
|
buildGoModule {
|
|
|
|
pname = "sops-install-secrets";
|
|
|
|
version = "0.0.1";
|
|
|
|
|
2023-11-13 20:46:25 +00:00
|
|
|
src = lib.sourceByRegex ../.. [ "go\.(mod|sum)" "pkgs" "pkgs/sops-install-secrets.*" ];
|
2020-07-06 06:30:09 +00:00
|
|
|
|
2020-07-12 12:50:55 +00:00
|
|
|
subPackages = [ "pkgs/sops-install-secrets" ];
|
|
|
|
|
2020-08-10 17:17:08 +00:00
|
|
|
# requires root privileges for tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-09-01 14:30:42 +00:00
|
|
|
passthru.tests = callPackages ./nixos-test.nix { };
|
2020-07-12 15:59:20 +00:00
|
|
|
|
2023-02-01 19:15:41 +00:00
|
|
|
outputs = [ "out" ] ++
|
2024-09-01 14:30:42 +00:00
|
|
|
lib.lists.optionals (stdenv.isLinux) [ "unittest" ];
|
2020-11-13 09:39:17 +00:00
|
|
|
|
2023-02-01 05:16:38 +00:00
|
|
|
postInstall = ''
|
2020-11-13 09:39:17 +00:00
|
|
|
go test -c ./pkgs/sops-install-secrets
|
2024-09-01 14:30:42 +00:00
|
|
|
'' + lib.optionalString (stdenv.isLinux) ''
|
2023-02-01 19:15:41 +00:00
|
|
|
# *.test is only tested on linux. $unittest does not exist on darwin.
|
2020-11-13 09:39:17 +00:00
|
|
|
install -D ./sops-install-secrets.test $unittest/bin/sops-install-secrets.test
|
2020-11-18 15:08:59 +00:00
|
|
|
# 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 09:39:17 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 06:19:01 +00:00
|
|
|
inherit vendorHash;
|
2020-07-12 16:18:12 +00:00
|
|
|
|
2021-02-01 02:02:21 +00:00
|
|
|
meta = with lib; {
|
2020-07-12 16:18:12 +00: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 11:12:14 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-07-12 16:18:12 +00:00
|
|
|
};
|
2020-07-06 06:30:09 +00:00
|
|
|
}
|