2016-03-24 12:42:27 +01: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 13:30:29 +01:00
|
|
|
make $makeFlags systemd-cryptsetup
|
2016-03-24 12:42:27 +01:00
|
|
|
make $makeFlags systemd-cryptsetup-generator
|
|
|
|
'';
|
|
|
|
|
2016-08-09 19:21:25 +02: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 19:21:58 +02:00
|
|
|
|
2016-08-15 12:41:45 +02:00
|
|
|
# TODO: Remove `.libs` prefix when the wrapper-script is gone
|
2016-03-24 12:42:27 +01:00
|
|
|
installPhase = ''
|
2016-03-24 13:30:29 +01:00
|
|
|
mkdir -p $out/lib/systemd/
|
2016-08-15 12:41:45 +02:00
|
|
|
cp .libs/systemd-cryptsetup $out/lib/systemd/systemd-cryptsetup
|
2016-08-09 19:21:25 +02:00
|
|
|
cp .libs/*.so $out/lib/
|
2016-03-24 15:50:39 +01:00
|
|
|
|
|
|
|
mkdir -p $out/lib/systemd/system-generators/
|
2016-08-09 19:21:25 +02:00
|
|
|
cp .libs/systemd-cryptsetup-generator $out/lib/systemd/system-generators/systemd-cryptsetup-generator
|
2016-03-24 12:42:27 +01:00
|
|
|
'';
|
|
|
|
})
|