2021-01-31 18:02:21 -08:00
|
|
|
{ stdenv, lib, buildGoModule, path, pkgs, vendorSha256, go }:
|
2020-07-06 07:30:09 +01:00
|
|
|
buildGoModule {
|
|
|
|
pname = "sops-install-secrets";
|
|
|
|
version = "0.0.1";
|
|
|
|
|
2020-07-12 13:50:55 +01:00
|
|
|
src = ../..;
|
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;
|
|
|
|
|
2020-07-12 16:59:20 +01:00
|
|
|
passthru.tests = import ./nixos-test.nix {
|
|
|
|
makeTest = import (path + "/nixos/tests/make-test-python.nix");
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
|
2023-02-01 20:15:41 +01:00
|
|
|
outputs = [ "out" ] ++
|
|
|
|
pkgs.lib.lists.optionals (pkgs.stdenv.isLinux) [ "unittest" ];
|
2020-11-13 10:39:17 +01:00
|
|
|
|
2023-02-01 13:16:38 +08:00
|
|
|
postInstall = ''
|
2020-11-13 10:39:17 +01:00
|
|
|
go test -c ./pkgs/sops-install-secrets
|
2023-02-01 20:15:41 +01:00
|
|
|
'' + pkgs.lib.optionalString (pkgs.stdenv.isLinux) ''
|
|
|
|
# *.test is only tested on linux. $unittest does not exist on darwin.
|
2020-11-13 10:39:17 +01:00
|
|
|
install -D ./sops-install-secrets.test $unittest/bin/sops-install-secrets.test
|
2020-11-18 16:08:59 +01: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 10:39:17 +01:00
|
|
|
'';
|
|
|
|
|
2020-07-12 17:18:12 +01:00
|
|
|
inherit vendorSha256;
|
|
|
|
|
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
|
|
|
}
|