python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / filesystems / stratisd / default.nix
blob68023a1265e75622af859ce92c268c1d602c9fc8
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , rustPlatform
5 , pkg-config
6 , asciidoc
7 , ncurses
8 , dbus
9 , cryptsetup
10 , util-linux
11 , udev
12 , systemd
13 , xfsprogs
14 , thin-provisioning-tools
15 , clevis
16 , jose
17 , jq
18 , curl
19 , tpm2-tools
20 , coreutils
21 , clevisSupport ? false
22 , nixosTests
25 stdenv.mkDerivation rec {
26   pname = "stratisd";
27   version = "3.3.0";
29   src = fetchFromGitHub {
30     owner = "stratis-storage";
31     repo = pname;
32     rev = "v${version}";
33     hash = "sha256-6CCSs359gPwUMQ2SFpxaWHXCjqqgIbvCaPL2zLuYRKg=";
34   };
36   cargoDeps = rustPlatform.fetchCargoTarball {
37     inherit src;
38     hash = "sha256-9nE/SFGv1tYyGDdemCahxHlRnLms3eK0r4XQMhQBjSQ=";
39   };
41   postPatch = ''
42     substituteInPlace udev/61-stratisd.rules \
43       --replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
44       --replace stratis-str-cmp       "$out/lib/udev/stratis-str-cmp"
46     substituteInPlace systemd/stratis-fstab-setup \
47       --replace stratis-min           "$out/bin/stratis-min" \
48       --replace systemd-ask-password  "${systemd}/bin/systemd-ask-password" \
49       --replace sleep                 "${coreutils}/bin/sleep" \
50       --replace udevadm               "${udev}/bin/udevadm"
51   '';
53   nativeBuildInputs = with rustPlatform; [
54     cargoSetupHook
55     bindgenHook
56     rust.cargo
57     rust.rustc
58     pkg-config
59     asciidoc
60     ncurses # tput
61   ];
63   buildInputs = [
64     dbus
65     cryptsetup
66     util-linux
67     udev
68   ];
70   EXECUTABLES_PATHS = lib.makeBinPath ([
71     xfsprogs
72     thin-provisioning-tools
73     udev
74   ] ++ lib.optionals clevisSupport [
75     clevis
76     jose
77     jq
78     cryptsetup
79     curl
80     tpm2-tools
81     coreutils
82   ]);
84   makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ];
85   buildFlags = [ "build" "build-min" "docs/stratisd.8" ];
87   doCheck = true;
88   checkTarget = "test";
90   # remove files for supporting dracut
91   postInstall = ''
92     rm -r "$out/lib/dracut"
93     rm -r "$out/lib/systemd/system-generators"
94   '';
96   passthru.tests = nixosTests.stratis;
98   meta = with lib; {
99     description = "Easy to use local storage management for Linux";
100     homepage = "https://stratis-storage.github.io";
101     license = licenses.mpl20;
102     maintainers = with maintainers; [ nickcao ];
103     platforms = [ "x86_64-linux" ];
104   };