nixpkgs/pkgs/by-name/th/thin-provisioning-tools/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

66 lines
2.1 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
nixosTests,
}:
rustPlatform.buildRustPackage rec {
pname = "thin-provisioning-tools";
version = "1.0.12";
src = fetchFromGitHub {
owner = "jthornber";
repo = "thin-provisioning-tools";
rev = "v${version}";
hash = "sha256-wliyTWo3iOonqf4UW50V5co0RQlc75VwLofF9FHV2LI=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"rio-0.9.4" = "sha256-2l5cm7YLZyf2kuRPMytu7Fdewi6x3+9KyyQBv2F8ZDA=";
};
};
passthru.tests = {
inherit (nixosTests.lvm2) lvm-thinpool-linux-latest;
};
# Uses O_DIRECT, which is not supported on all filesystems.
# https://github.com/jthornber/thin-provisioning-tools/issues/38
doCheck = false;
# required for config compatibility with configs done pre 0.9.0
# see https://github.com/NixOS/nixpkgs/issues/317018
postInstall = ''
ln -s $out/bin/pdata_tools $out/bin/cache_check
ln -s $out/bin/pdata_tools $out/bin/cache_dump
ln -s $out/bin/pdata_tools $out/bin/cache_metadata_size
ln -s $out/bin/pdata_tools $out/bin/cache_repair
ln -s $out/bin/pdata_tools $out/bin/cache_restore
ln -s $out/bin/pdata_tools $out/bin/cache_writeback
ln -s $out/bin/pdata_tools $out/bin/era_check
ln -s $out/bin/pdata_tools $out/bin/era_dump
ln -s $out/bin/pdata_tools $out/bin/era_invalidate
ln -s $out/bin/pdata_tools $out/bin/era_restore
ln -s $out/bin/pdata_tools $out/bin/thin_check
ln -s $out/bin/pdata_tools $out/bin/thin_delta
ln -s $out/bin/pdata_tools $out/bin/thin_dump
ln -s $out/bin/pdata_tools $out/bin/thin_ls
ln -s $out/bin/pdata_tools $out/bin/thin_metadata_size
ln -s $out/bin/pdata_tools $out/bin/thin_repair
ln -s $out/bin/pdata_tools $out/bin/thin_restore
ln -s $out/bin/pdata_tools $out/bin/thin_rmap
ln -s $out/bin/pdata_tools $out/bin/thin_trim
'';
meta = with lib; {
homepage = "https://github.com/jthornber/thin-provisioning-tools/";
description = "Suite of tools for manipulating the metadata of the dm-thin device-mapper target";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ ];
};
}