mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-05 20:19:16 +03:00
clevis: rework - move and format postPatch and postInstall
Gather the shell script snippets to their own place.
This commit is contained in:
parent
9957f043cc
commit
09fd98c433
@ -37,19 +37,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
./0000-tang-timeout.patch
|
||||
];
|
||||
|
||||
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 ':' "${lib.makeBinPath [tpm2-tools jose cryptsetup libpwquality luksmeta gnugrep gnused coreutils]}:${placeholder "out"}/bin"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
asciidoc
|
||||
makeWrapper
|
||||
@ -73,6 +60,32 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"man"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
for f in $(find src/ -type f); do
|
||||
grep -q "/bin/cat" "$f" && substituteInPlace "$f" \
|
||||
--replace-fail '/bin/cat' '${lib.getExe' coreutils "cat"}' || true
|
||||
done
|
||||
'';
|
||||
|
||||
# We wrap the main clevis binary entrypoint but not the sub-binaries.
|
||||
postInstall =
|
||||
let
|
||||
includeIntoPath = [
|
||||
coreutils
|
||||
cryptsetup
|
||||
gnugrep
|
||||
gnused
|
||||
jose
|
||||
libpwquality
|
||||
luksmeta
|
||||
tpm2-tools
|
||||
];
|
||||
in
|
||||
''
|
||||
wrapProgram $out/bin/clevis \
|
||||
--prefix PATH ':' "${lib.makeBinPath includeIntoPath}:${placeholder "out"}/bin"
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests.installer) clevisBcachefs clevisBcachefsFallback clevisLuks clevisLuksFallback clevisZfs clevisZfsFallback;
|
||||
clevisLuksSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuks;
|
||||
|
Loading…
Reference in New Issue
Block a user