diff --git a/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix b/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix new file mode 100644 index 00000000000..efad362e886 --- /dev/null +++ b/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix @@ -0,0 +1,21 @@ +{ 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 + make $makeFlags systemd-cryptsetup-generator + ''; + + installPhase = '' + mkdir -p $out/lib/systemd/system-generators/ + cp systemd-cryptsetup-generator $out/lib/systemd/system-generators/systemd-cryptsetup-generator + ''; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c0a45379793..392ead817f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10997,6 +10997,9 @@ in inherit cryptsetup; }); + # The standalone cryptsetup generator for systemd + systemd-cryptsetup-generator = callPackage ../os-specific/linux/systemd/cryptsetup-generator.nix { }; + # In nixos, you can set systemd.package = pkgs.systemd_with_lvm2 to get # LVM2 working in systemd. systemd_with_lvm2 = pkgs.lib.overrideDerivation pkgs.systemd (p: {