2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, asciidoc
|
2021-05-01 18:03:56 +00:00
|
|
|
, makeWrapper, jansson, jose, cryptsetup, curl, libpwquality, luksmeta
|
|
|
|
, coreutils, tpm2-tools
|
2020-02-09 17:35:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clevis";
|
2021-04-22 07:38:12 +00:00
|
|
|
version = "18";
|
2020-02-09 17:35:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "latchset";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-04-22 07:38:12 +00:00
|
|
|
sha256 = "sha256-m1UhyjD5ydSgCTBu6sECLlxFx0rnQxFnBA7frbdUqU8=";
|
2020-02-09 17:35:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-01 18:03:56 +00:00
|
|
|
postPatch = ''
|
|
|
|
for f in $(find src/ -type f); do
|
|
|
|
grep -q "/bin/cat" "$f" && substituteInPlace "$f" \
|
|
|
|
--replace '/bin/cat' '${coreutils}/bin/cat' || true
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# We wrap the main clevis binary entrypoint but not the sub-binaries.
|
|
|
|
wrapProgram $out/bin/clevis \
|
|
|
|
--prefix PATH ':' "${tpm2-tools}/bin:${jose}/bin:${placeholder "out"}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ meson ninja pkg-config asciidoc makeWrapper ];
|
|
|
|
buildInputs = [ jansson jose cryptsetup curl libpwquality luksmeta tpm2-tools ];
|
2020-02-09 17:35:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Automated Encryption Framework";
|
|
|
|
homepage = "https://github.com/latchset/clevis";
|
|
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|