1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00
sops-nix/default.nix
Jörg Thalheim 8c944d29e8
go mod tidy
2022-05-14 06:31:05 +02:00

57 lines
1.7 KiB
Nix

{ pkgs ? import <nixpkgs> {} }: let
vendorSha256 = "sha256-nqA2zzCsWXCllpsss0tjjo4ivi3MVuEM3W6dEZc5KAc=";
sops-install-secrets = pkgs.callPackage ./pkgs/sops-install-secrets {
inherit vendorSha256;
};
in rec {
sops-init-gpg-key = pkgs.callPackage ./pkgs/sops-init-gpg-key {};
sops-pgp-hook = pkgs.lib.warn ''
sops-pgp-hook is deprecated, use sops-import-keys-hook instead.
Also see https://github.com/Mic92/sops-nix/issues/98
'' pkgs.callPackage ./pkgs/sops-pgp-hook { };
sops-import-keys-hook = pkgs.callPackage ./pkgs/sops-import-keys-hook { };
# backwards compatibility
inherit (pkgs) ssh-to-pgp;
# used in the CI only
sops-pgp-hook-test = pkgs.buildGoModule {
name = "sops-pgp-hook-test";
src = ./.;
inherit vendorSha256;
buildPhase = ''
go test -c ./pkgs/sops-pgp-hook
install -D sops-pgp-hook.test $out/bin/sops-pgp-hook.test
'';
};
unit-tests = pkgs.callPackage ./unit-tests.nix {};
} // (pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
inherit sops-install-secrets;
lint = sops-install-secrets.overrideAttrs (old: {
name = "golangci-lint";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.golangci-lint ];
buildPhase = ''
HOME=$TMPDIR golangci-lint run --timeout 360s
'';
doCheck = false;
installPhase = ''
touch $out $unittest
'';
fixupPhase = ":";
});
cross-build = sops-install-secrets.overrideAttrs (old: {
name = "cross-build";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gox ];
buildPhase = ''
(cd pkgs/sops-install-secrets && gox -os linux)
'';
doCheck = false;
installPhase = ''
touch $out $unittest
'';
fixupPhase = ":";
});
})