From 16543b630a58e4b4c0100d130d72a8c5b25fac8f Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 8 Mar 2022 09:26:29 -0500 Subject: [PATCH] zpool-auto-expand-partitions: init at 0.1.0 --- .../zpool-auto-expand-partitions/default.nix | 46 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/tools/filesystems/zpool-auto-expand-partitions/default.nix diff --git a/pkgs/tools/filesystems/zpool-auto-expand-partitions/default.nix b/pkgs/tools/filesystems/zpool-auto-expand-partitions/default.nix new file mode 100644 index 000000000000..afafbca58baf --- /dev/null +++ b/pkgs/tools/filesystems/zpool-auto-expand-partitions/default.nix @@ -0,0 +1,46 @@ +{ rustPlatform +, cloud-utils +, fetchFromGitHub +, lib +, llvmPackages +, pkg-config +, util-linux +, zfs +}: +rustPlatform.buildRustPackage rec { + pname = "zpool-auto-expand-partitions"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "DeterminateSystems"; + repo = "zpool-auto-expand-partitions"; + rev = "v${version}"; + hash = "sha256-LA6YO6vv7VCXwFfayQVxVR80niSCo89sG0hqh0wDEh8="; + }; + + cargoHash = "sha256-5v0fqp8aro+QD/f5VudMREc8RvKQapNAoArcCKMN1Sw="; + + preBuild = '' + substituteInPlace src/grow.rs \ + --replace '"growpart"' '"${cloud-utils}/bin/growpart"' + substituteInPlace src/lsblk.rs \ + --replace '"lsblk"' '"${util-linux}/bin/lsblk"' + ''; + + nativeBuildInputs = [ + pkg-config + rustPlatform.bindgenHook + ]; + + buildInputs = [ + util-linux + zfs + ]; + + meta = with lib; { + description = "A tool that aims to expand all partitions in a specified zpool to fill the available space"; + homepage = "https://github.com/DeterminateSystems/zpool-auto-expand-partitions"; + license = licenses.asl20; + maintainers = teams.determinatesystems.members; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d640c6b1ac2..92ecf9691692 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11619,6 +11619,8 @@ with pkgs; zfsnap = callPackage ../tools/backup/zfsnap { }; + zpool-auto-expand-partitions = callPackage ../tools/filesystems/zpool-auto-expand-partitions { }; + zile = callPackage ../applications/editors/zile { }; zinnia = callPackage ../tools/inputmethods/zinnia { };