Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 76 lines 2.3 kB view raw
1{ 2 lib, 3 rustPlatform, 4 pkg-config, 5 udev, 6 lvm2, 7 fetchFromGitHub, 8 nixosTests, 9}: 10rustPlatform.buildRustPackage rec { 11 pname = "thin-provisioning-tools"; 12 version = "1.2.0"; 13 14 src = fetchFromGitHub { 15 owner = "jthornber"; 16 repo = "thin-provisioning-tools"; 17 rev = "v${version}"; 18 hash = "sha256-gjsURDzA4LRTTgKZPzzTcvTdi1mXx4FkWmyoPcpdPfU="; 19 }; 20 21 strictDeps = true; 22 depsBuildBuild = [ 23 pkg-config 24 lvm2 25 udev 26 ]; 27 nativeBuildInputs = [ 28 rustPlatform.bindgenHook 29 ]; 30 buildInputs = [ 31 lvm2 32 udev 33 ]; 34 35 cargoHash = "sha256-H5GRAZpFl2t/bH8THyPkZq5ptS70XkhSCxQ6ko+0RC8="; 36 37 passthru.tests = { 38 inherit (nixosTests.lvm2) lvm-thinpool-linux-latest; 39 }; 40 41 # Uses O_DIRECT, which is not supported on all filesystems. 42 # https://github.com/jthornber/thin-provisioning-tools/issues/38 43 doCheck = false; 44 45 # required for config compatibility with configs done pre 0.9.0 46 # see https://github.com/NixOS/nixpkgs/issues/317018 47 postInstall = '' 48 ln -s $out/bin/pdata_tools $out/bin/cache_check 49 ln -s $out/bin/pdata_tools $out/bin/cache_dump 50 ln -s $out/bin/pdata_tools $out/bin/cache_metadata_size 51 ln -s $out/bin/pdata_tools $out/bin/cache_repair 52 ln -s $out/bin/pdata_tools $out/bin/cache_restore 53 ln -s $out/bin/pdata_tools $out/bin/cache_writeback 54 ln -s $out/bin/pdata_tools $out/bin/era_check 55 ln -s $out/bin/pdata_tools $out/bin/era_dump 56 ln -s $out/bin/pdata_tools $out/bin/era_invalidate 57 ln -s $out/bin/pdata_tools $out/bin/era_restore 58 ln -s $out/bin/pdata_tools $out/bin/thin_check 59 ln -s $out/bin/pdata_tools $out/bin/thin_delta 60 ln -s $out/bin/pdata_tools $out/bin/thin_dump 61 ln -s $out/bin/pdata_tools $out/bin/thin_ls 62 ln -s $out/bin/pdata_tools $out/bin/thin_metadata_size 63 ln -s $out/bin/pdata_tools $out/bin/thin_repair 64 ln -s $out/bin/pdata_tools $out/bin/thin_restore 65 ln -s $out/bin/pdata_tools $out/bin/thin_rmap 66 ln -s $out/bin/pdata_tools $out/bin/thin_trim 67 ''; 68 69 meta = with lib; { 70 homepage = "https://github.com/jthornber/thin-provisioning-tools/"; 71 description = "Suite of tools for manipulating the metadata of the dm-thin device-mapper target"; 72 license = licenses.gpl3; 73 platforms = platforms.unix; 74 maintainers = [ ]; 75 }; 76}