2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, asciidoc
|
2022-10-30 15:09:59 +00:00
|
|
|
, ncurses
|
2023-02-02 18:25:31 +00:00
|
|
|
, glibc
|
2022-09-09 14:08:57 +00:00
|
|
|
, dbus
|
|
|
|
, cryptsetup
|
|
|
|
, util-linux
|
|
|
|
, udev
|
2023-03-24 00:07:29 +00:00
|
|
|
, lvm2
|
2022-09-09 14:08:57 +00:00
|
|
|
, systemd
|
|
|
|
, xfsprogs
|
|
|
|
, thin-provisioning-tools
|
|
|
|
, clevis
|
|
|
|
, jose
|
|
|
|
, jq
|
|
|
|
, curl
|
|
|
|
, tpm2-tools
|
|
|
|
, coreutils
|
|
|
|
, clevisSupport ? false
|
2022-09-22 12:36:57 +00:00
|
|
|
, nixosTests
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "stratisd";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.5.4";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stratis-storage";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-V/1gNgjunT11ErXWIa5hDp2+onPCTequCswwXWD5+9E=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-RljuLL8tep42KNGVsS5CxI7xuhxEjRZ90jVn3jUhVYM=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace udev/61-stratisd.rules \
|
|
|
|
--replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
|
|
|
|
--replace stratis-str-cmp "$out/lib/udev/stratis-str-cmp"
|
|
|
|
|
|
|
|
substituteInPlace systemd/stratis-fstab-setup \
|
|
|
|
--replace stratis-min "$out/bin/stratis-min" \
|
|
|
|
--replace systemd-ask-password "${systemd}/bin/systemd-ask-password" \
|
|
|
|
--replace sleep "${coreutils}/bin/sleep" \
|
|
|
|
--replace udevadm "${udev}/bin/udevadm"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
bindgenHook
|
|
|
|
rust.cargo
|
|
|
|
rust.rustc
|
|
|
|
pkg-config
|
|
|
|
asciidoc
|
2022-10-30 15:09:59 +00:00
|
|
|
ncurses # tput
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-02-02 18:25:31 +00:00
|
|
|
glibc
|
|
|
|
glibc.static
|
2022-09-09 14:08:57 +00:00
|
|
|
dbus
|
|
|
|
cryptsetup
|
|
|
|
util-linux
|
|
|
|
udev
|
2023-03-24 00:07:29 +00:00
|
|
|
lvm2
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
EXECUTABLES_PATHS = lib.makeBinPath ([
|
2022-09-09 14:08:57 +00:00
|
|
|
xfsprogs
|
|
|
|
thin-provisioning-tools
|
|
|
|
] ++ lib.optionals clevisSupport [
|
|
|
|
clevis
|
|
|
|
jose
|
|
|
|
jq
|
|
|
|
cryptsetup
|
|
|
|
curl
|
|
|
|
tpm2-tools
|
|
|
|
coreutils
|
|
|
|
]);
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ];
|
2023-02-02 18:25:31 +00:00
|
|
|
buildFlags = [ "build-all" ];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
# remove files for supporting dracut
|
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out/lib/dracut"
|
|
|
|
rm -r "$out/lib/systemd/system-generators"
|
|
|
|
'';
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
passthru.tests = nixosTests.stratis;
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Easy to use local storage management for Linux";
|
|
|
|
homepage = "https://stratis-storage.github.io";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ nickcao ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|