nixpkgs/pkgs/tools/filesystems/stratisd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
2.2 KiB
Nix
Raw Normal View History

2022-08-01 12:42:58 +00:00
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, cargo
, rustc
2022-08-01 12:42:58 +00:00
, pkg-config
, asciidoc
2022-10-19 02:09:16 +00:00
, ncurses
, glibc
2022-08-01 12:42:58 +00:00
, dbus
, cryptsetup
, util-linux
, udev
, lvm2
2022-08-01 12:42:58 +00:00
, systemd
, xfsprogs
, thin-provisioning-tools
, clevis
, jose
, jq
, curl
, tpm2-tools
, coreutils
, clevisSupport ? false
, nixosTests
2022-08-01 12:42:58 +00:00
}:
stdenv.mkDerivation rec {
pname = "stratisd";
version = "3.5.4";
2022-08-01 12:42:58 +00:00
src = fetchFromGitHub {
owner = "stratis-storage";
repo = pname;
rev = "v${version}";
hash = "sha256-V/1gNgjunT11ErXWIa5hDp2+onPCTequCswwXWD5+9E=";
2022-08-01 12:42:58 +00:00
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
hash = "sha256-RljuLL8tep42KNGVsS5CxI7xuhxEjRZ90jVn3jUhVYM=";
2022-08-01 12:42:58 +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 = [
rustPlatform.cargoSetupHook
rustPlatform.bindgenHook
cargo
rustc
2022-08-01 12:42:58 +00:00
pkg-config
asciidoc
2022-10-19 02:09:16 +00:00
ncurses # tput
2022-08-01 12:42:58 +00:00
];
buildInputs = [
glibc
glibc.static
2022-08-01 12:42:58 +00:00
dbus
cryptsetup
util-linux
udev
lvm2
2022-08-01 12:42:58 +00:00
];
2022-10-19 02:09:16 +00:00
EXECUTABLES_PATHS = lib.makeBinPath ([
2022-08-01 12:42:58 +00:00
xfsprogs
thin-provisioning-tools
] ++ lib.optionals clevisSupport [
clevis
jose
jq
cryptsetup
curl
tpm2-tools
coreutils
]);
2022-10-19 02:09:16 +00:00
makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ];
buildFlags = [ "build-all" ];
2022-08-01 12:42:58 +00:00
doCheck = true;
checkTarget = "test";
# remove files for supporting dracut
postInstall = ''
rm -r "$out/lib/dracut"
rm -r "$out/lib/systemd/system-generators"
'';
passthru.tests = nixosTests.stratis;
2022-08-01 12:42:58 +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" ];
};
}