Skip to content

Commit

Permalink
Merge pull request #263716 from Mic92/zfstools
Browse files Browse the repository at this point in the history
zfstools: fix missing zpool in PATH
  • Loading branch information
Ma27 authored Nov 4, 2023
2 parents e181a9d + 09f7789 commit b4c0c73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkgs/tools/filesystems/zfstools/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, ruby, zfs }:
{ lib, stdenv, fetchFromGitHub, ruby, zfs, makeWrapper }:

stdenv.mkDerivation rec {
pname = "zfstools";
Expand All @@ -12,6 +12,7 @@ stdenv.mkDerivation rec {
};

buildInputs = [ ruby ];
nativeBuildInputs = [ makeWrapper ];

installPhase = ''
mkdir -p $out/bin
Expand All @@ -20,10 +21,10 @@ stdenv.mkDerivation rec {
cp -R lib $out/
for f in $out/bin/*; do
substituteInPlace $f --replace "/usr/bin/env ruby" "ruby -I$out/lib"
wrapProgram $f \
--set RUBYLIB $out/lib \
--prefix PATH : ${zfs}/bin
done
sed -e 's|cmd.*=.*"zfs |cmd = "${zfs}/sbin/zfs |g' -i $out/lib/zfstools/{dataset,snapshot}.rb
'';

meta = with lib; {
Expand Down

0 comments on commit b4c0c73

Please sign in to comment.