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