agenix/pkgs/agenix.nix

38 lines
685 B
Nix
Raw Normal View History

{
lib,
stdenv,
rage,
2023-02-13 19:06:58 +03:00
jq,
nix,
mktemp,
2021-07-22 14:58:29 +03:00
diffutils,
substituteAll,
ageBin ? "${rage}/bin/rage",
shellcheck,
}:
stdenv.mkDerivation rec {
pname = "agenix";
2023-12-20 19:33:16 +03:00
version = "0.15.0";
src = substituteAll {
inherit ageBin version;
2023-02-13 19:06:58 +03:00
jqBin = "${jq}/bin/jq";
nixInstantiate = "${nix}/bin/nix-instantiate";
mktempBin = "${mktemp}/bin/mktemp";
diffBin = "${diffutils}/bin/diff";
src = ./agenix.sh;
};
dontUnpack = true;
doCheck = true;
checkInputs = [shellcheck];
postCheck = ''
shellcheck $src
'';
installPhase = ''
install -D $src ${placeholder "out"}/bin/agenix
'';
meta.description = "age-encrypted secrets for NixOS";
}