agenix/pkgs/agenix.nix

38 lines
695 B
Nix
Raw Normal View History

{
lib,
stdenv,
rage,
gnused,
nix,
mktemp,
2021-07-22 14:58:29 +03:00
diffutils,
substituteAll,
ageBin ? "${rage}/bin/rage",
shellcheck,
}:
stdenv.mkDerivation rec {
pname = "agenix";
version = "0.13.0";
src = substituteAll {
inherit ageBin version;
sedBin = "${gnused}/bin/sed";
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";
}