systemd: Wrap in LUKS2 tokens
Update pkgs/os-specific/linux/systemd/default.nix Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com> Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
parent
f42cdfe227
commit
570824e102
|
@ -403,6 +403,9 @@ in {
|
|||
|
||||
# so NSS can look up usernames
|
||||
"${pkgs.glibc}/lib/libnss_files.so.2"
|
||||
] ++ optionals cfg.package.withCryptsetup [
|
||||
# the unwrapped systemd-cryptsetup executable
|
||||
"${cfg.package}/lib/systemd/.systemd-cryptsetup-wrapped"
|
||||
] ++ jobScripts;
|
||||
|
||||
targets.initrd.aliases = ["default.target"];
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
, fetchpatch
|
||||
, fetchzip
|
||||
, buildPackages
|
||||
, makeBinaryWrapper
|
||||
, ninja
|
||||
, meson
|
||||
, m4
|
||||
|
@ -332,6 +333,7 @@ stdenv.mkDerivation {
|
|||
nativeBuildInputs =
|
||||
[
|
||||
pkg-config
|
||||
makeBinaryWrapper
|
||||
gperf
|
||||
ninja
|
||||
meson
|
||||
|
@ -666,7 +668,14 @@ stdenv.mkDerivation {
|
|||
preFixup = lib.optionalString withEfi ''
|
||||
mv $out/lib/systemd/boot/efi $out/dont-strip-me
|
||||
'';
|
||||
postFixup = lib.optionalString withEfi ''
|
||||
|
||||
# Wrap in the correct path for LUKS2 tokens.
|
||||
postFixup = lib.optionalString withCryptsetup ''
|
||||
for f in lib/systemd/systemd-cryptsetup bin/systemd-cryptenroll; do
|
||||
# This needs to be in LD_LIBRARY_PATH because rpath on a binary is not propagated to libraries using dlopen, in this case `libcryptsetup.so`
|
||||
wrapProgram $out/$f --prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib/cryptsetup
|
||||
done
|
||||
'' + lib.optionalString withEfi ''
|
||||
mv $out/dont-strip-me $out/lib/systemd/boot/efi
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue