summary refs log tree commit diff
path: root/pkgs/tools/misc/rshim-user-space/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/rshim-user-space/default.nix')
-rw-r--r--pkgs/tools/misc/rshim-user-space/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/tools/misc/rshim-user-space/default.nix b/pkgs/tools/misc/rshim-user-space/default.nix
index 79b795f869a..25550f45c4f 100644
--- a/pkgs/tools/misc/rshim-user-space/default.nix
+++ b/pkgs/tools/misc/rshim-user-space/default.nix
@@ -3,10 +3,14 @@
 , fetchFromGitHub
 , autoconf
 , automake
+, makeBinaryWrapper
 , pkg-config
 , pciutils
 , libusb1
 , fuse
+, busybox
+, pv
+, withBfbInstall ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -24,7 +28,7 @@ stdenv.mkDerivation rec {
     autoconf
     automake
     pkg-config
-  ];
+  ] ++ lib.optionals withBfbInstall [ makeBinaryWrapper ];
 
   buildInputs = [
     pciutils
@@ -39,6 +43,13 @@ stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p "$out"/bin
     cp -a src/rshim "$out"/bin/
+  '' + lib.optionalString withBfbInstall ''
+    cp -a scripts/bfb-install "$out"/bin/
+  '';
+
+  postFixup = lib.optionalString withBfbInstall ''
+    wrapProgram $out/bin/bfb-install \
+      --set PATH ${lib.makeBinPath [ busybox pv ]}
   '';
 
   meta = with lib; {