From 18b5ca29f5056bcfc280b76037a08c95a3e31f04 Mon Sep 17 00:00:00 2001 From: David Guibert Date: Wed, 9 Oct 2019 09:50:12 +0200 Subject: [PATCH] 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. --- pkgs/tools/system/inxi/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/inxi/default.nix b/pkgs/tools/system/inxi/default.nix index 3c1e3e79862..a896a57b080 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/ '';