18 , thin-provisioning-tools
25 , clevisSupport ? false
29 stdenv.mkDerivation rec {
33 src = fetchFromGitHub {
34 owner = "stratis-storage";
36 rev = "refs/tags/stratisd-v${version}";
37 hash = "sha256-pxLf/YLd7vdAjGRQDvJvwhJXpMUiI3dge5Y5x895SPA=";
40 cargoDeps = rustPlatform.fetchCargoTarball {
42 hash = "sha256-btSj69yBbnbK+jdWdMi3rQGKMOLWcwY5Zn3hmEWk/Hs=";
46 substituteInPlace udev/61-stratisd.rules \
47 --replace-fail stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
48 --replace-fail stratis-str-cmp "$out/lib/udev/stratis-str-cmp"
50 substituteInPlace systemd/stratis-fstab-setup \
51 --replace-fail stratis-min "$out/bin/stratis-min" \
52 --replace-fail systemd-ask-password "${systemd}/bin/systemd-ask-password" \
53 --replace-fail sleep "${coreutils}/bin/sleep" \
54 --replace-fail udevadm "${systemd}/bin/udevadm"
60 rustPlatform.cargoSetupHook
61 rustPlatform.bindgenHook
77 (python3.withPackages (ps: [ ps.dbus-python ]))
80 outputs = [ "out" "initrd" ];
82 env.EXECUTABLES_PATHS = lib.makeBinPath ([
84 thin-provisioning-tools
85 ] ++ lib.optionals clevisSupport [
95 makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ];
96 buildFlags = [ "build-all" ];
101 # remove files for supporting dracut
103 mkdir -p "$initrd/bin"
104 cp "$out/lib/dracut/modules.d/90stratis/stratis-rootfs-setup" "$initrd/bin"
105 mkdir -p "$initrd/lib/systemd/system"
106 substitute "$out/lib/dracut/modules.d/90stratis/stratisd-min.service" \
107 "$initrd/lib/systemd/system/stratisd-min.service" \
108 --replace-fail mkdir "${coreutils}/bin/mkdir"
109 mkdir -p "$initrd/lib/udev/rules.d"
110 cp udev/61-stratisd.rules "$initrd/lib/udev/rules.d"
111 rm -r "$out/lib/dracut"
112 rm -r "$out/lib/systemd/system-generators"
115 passthru.tests = nixosTests.stratis // {
116 inherit (nixosTests.installer-systemd-stage-1) stratisRoot;
120 description = "Easy to use local storage management for Linux";
121 homepage = "https://stratis-storage.github.io";
122 license = licenses.mpl20;
123 maintainers = with maintainers; [ nickcao ];
124 platforms = [ "x86_64-linux" ];