23 stdenv.mkDerivation (finalAttrs: {
27 src = fetchFromGitHub {
30 rev = "refs/tags/v${finalAttrs.version}";
31 hash = "sha256-rBdZrnHPzRd9vbyl1h/Nb0cFAtIPUHSmxVoKrKuCrQ8=";
35 # Replaces the clevis-decrypt 300s timeout to a 10s timeout
36 # https://github.com/latchset/clevis/issues/289
37 ./0000-tang-timeout.patch
63 # TODO: investigate how to prepare the dependencies so that they can be found
64 # while setting strictDeps as true. This will require studying the dark
65 # corners of cross-compilation in Nixpkgs...
68 # Since 2018-07-11, upstream relies on a hardcoded /bin/cat. See:
69 # https://github.com/latchset/clevis/issues/61
70 # https://github.com/latchset/clevis/pull/64
72 # So, we filter all src files that have the string "/bin/cat" and patch that
73 # string to an absolute path for our coreutils location.
74 # The xargs command is a little bit convoluted because a simpler version would
75 # be vulnerable to code injection. This hint is a courtesy of Stack Exchange:
76 # https://unix.stackexchange.com/a/267438
78 for f in $(find src/ -type f -print0 |\
79 xargs -0 -I@ sh -c 'grep -q "/bin/cat" "$1" && echo "$1"' sh @); do
80 substituteInPlace "$f" --replace-fail '/bin/cat' '${lib.getExe' coreutils "cat"}'
84 # We wrap the main clevis binary entrypoint but not the sub-binaries.
99 wrapProgram $out/bin/clevis \
100 --prefix PATH ':' "${lib.makeBinPath includeIntoPath}:${placeholder "out"}/bin"
104 inherit (nixosTests.installer)
106 clevisBcachefsFallback
112 clevisLuksSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuks;
113 clevisLuksFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuksFallback;
114 clevisZfsSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfs;
115 clevisZfsFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfsFallback;
119 homepage = "https://github.com/latchset/clevis";
120 description = "Automated Encryption Framework";
122 Clevis is a pluggable framework for automated decryption. It can be used
123 to provide automated decryption of data or even automated unlocking of
126 changelog = "https://github.com/latchset/clevis/releases/tag/v${finalAttrs.version}";
127 license = lib.licenses.gpl3Plus;
128 maintainers = with lib.maintainers; [ AndersonTorres ];