summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--overlays/clevis.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/overlays/clevis.nix b/overlays/clevis.nix
new file mode 100644
index 00000000..a786340c
--- /dev/null
+++ b/overlays/clevis.nix
@@ -0,0 +1,37 @@
1final: prev:
2{
3 clevis = prev.clevis.overrideAttrs (oldAttrs: {
4 buildInputs = (oldAttrs.buildInputs or []) ++ [final.tpm2-tools];
5 nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [final.makeWrapper];
6
7 preFixup = ''
8 ${oldAttrs.preFixup or ""}
9
10 for bin in $out/bin/*; do
11 test -x $bin || continue
12
13 substituteInPlace $bin \
14 --replace /bin/cat ${final.coreutils}/bin/cat
15
16 wrapProgram $bin \
17 --prefix PATH : ${final.tpm2-tools}/bin \
18 --prefix PATH : ${final.jose}/bin \
19 --prefix PATH : ${final.libpwquality}/bin
20 done
21 '';
22 });
23
24 tpm2-tools = prev.tpm2-tools.overrideAttrs (oldAttrs: {
25 fixupPhase = ''
26 ${oldAttrs.fixupPhase or ""}
27
28 for wrapper in $out/bin/tpm2_*; do
29 symlink=.''${wrapper}-wrapped
30
31 test -h $symlink || continue
32
33 mv -v $symlink $wrapper
34 done
35 '';
36 });
37}