2016-03-24 14:42:27 +03:00
|
|
|
{ stdenv, systemd, cryptsetup }:
|
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
|
|
|
stdenv.lib.overrideDerivation systemd (p: {
|
|
|
|
version = p.version;
|
|
|
|
name = "systemd-cryptsetup-generator";
|
|
|
|
|
|
|
|
nativeBuildInputs = p.nativeBuildInputs ++ [ cryptsetup ];
|
|
|
|
outputs = [ "out" ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make $makeFlags built-sources
|
2016-03-24 15:30:29 +03:00
|
|
|
make $makeFlags systemd-cryptsetup
|
2016-03-24 14:42:27 +03:00
|
|
|
make $makeFlags systemd-cryptsetup-generator
|
|
|
|
'';
|
|
|
|
|
2016-08-09 20:21:25 +03:00
|
|
|
# For some reason systemd-cryptsetup-generator is a wrapper-script
|
|
|
|
# with the current release of systemd. We want the real one.
|
2016-08-09 20:21:58 +03:00
|
|
|
|
2016-08-15 13:41:45 +03:00
|
|
|
# TODO: Remove `.libs` prefix when the wrapper-script is gone
|
2016-03-24 14:42:27 +03:00
|
|
|
installPhase = ''
|
2016-03-24 15:30:29 +03:00
|
|
|
mkdir -p $out/lib/systemd/
|
2016-08-15 13:41:45 +03:00
|
|
|
cp .libs/systemd-cryptsetup $out/lib/systemd/systemd-cryptsetup
|
2016-08-09 20:21:25 +03:00
|
|
|
cp .libs/*.so $out/lib/
|
2016-03-24 17:50:39 +03:00
|
|
|
|
|
|
|
mkdir -p $out/lib/systemd/system-generators/
|
2016-08-09 20:21:25 +03:00
|
|
|
cp .libs/systemd-cryptsetup-generator $out/lib/systemd/system-generators/systemd-cryptsetup-generator
|
2016-03-24 14:42:27 +03:00
|
|
|
'';
|
|
|
|
})
|