about summary refs log tree commit diff
path: root/pkgs/tools/system/inxi
diff options
context:
space:
mode:
authorDavid Guibert <david.guibert@gmail.com>2019-10-09 09:50:12 +0200
committerJon <jonringer@users.noreply.github.com>2019-10-09 08:30:56 -0700
commit18b5ca29f5056bcfc280b76037a08c95a3e31f04 (patch)
tree9fc0fa9650344b07029aa28883985153227c9d23 /pkgs/tools/system/inxi
parent164c0a29eec9cf7e1be9fd216528cc0230bc258c (diff)
downloadnixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar.gz
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar.bz2
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar.lz
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar.xz
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.tar.zst
nixlib-18b5ca29f5056bcfc280b76037a08c95a3e31f04.zip
inxi: enable json output
Before this patch:
$ inxi --output json --output-file output.json $additional_args
Error 80: The required json Perl module is not installed:
Cpanel::JSON::XS OR JSON::XS
See --recommends for more information.

With this patch, it works as expected:
$ inxi --output json --output-file output.json $additional_args
Writing JSON data to: output.json
Data written successfully.
Diffstat (limited to 'pkgs/tools/system/inxi')
-rw-r--r--pkgs/tools/system/inxi/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/tools/system/inxi/default.nix b/pkgs/tools/system/inxi/default.nix
index 3c1e3e798623..a896a57b0806 100644
--- a/pkgs/tools/system/inxi/default.nix
+++ b/pkgs/tools/system/inxi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl }:
+{ stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "inxi";
@@ -11,11 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "04134l323vwd0g2bffj11rnpw2jgs9la6aqrmv8vh7w9mq5nd57y";
   };
 
-  buildInputs = [ perl ];
+  buildInputs = [ perl makeWrapper ];
 
   installPhase = ''
     mkdir -p $out/bin
     cp inxi $out/bin/
+    wrapProgram $out/bin/inxi \
+      --set PERL5LIB "${perlPackages.makePerlPath (with perlPackages; [ CpanelJSONXS ])}"
     mkdir -p $out/share/man/man1
     cp inxi.1 $out/share/man/man1/
   '';