Merge pull request #145231 from thiagokokada/use-makewrapper-terranix
terranix: use wrapProgram on terranix-doc-json
This commit is contained in:
commit
6c9ac6fb13
1 changed files with 6 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, lib, fetchFromGitHub, jq, nix, ... }:
|
||||
{ stdenv, lib, fetchFromGitHub, jq, nix, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "terranix";
|
||||
|
@ -11,29 +11,21 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "sha256-HDiyJGgyDUoLnpL8N+wDm3cM/vEfYYc/p4N1kKH/kLk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{bin,core,modules,lib}
|
||||
mv bin core modules lib $out/
|
||||
|
||||
mv $out/bin/terranix-doc-json $out/bin/.wrapper_terranix-doc-json
|
||||
|
||||
# manual wrapper because makeWrapper expectes executables
|
||||
wrapper=$out/bin/terranix-doc-json
|
||||
cat <<EOF>$wrapper
|
||||
#!/usr/bin/env bash
|
||||
export PATH=$PATH:${jq}/bin:${nix}/bin
|
||||
$out/bin/.wrapper_terranix-doc-json "\$@"
|
||||
EOF
|
||||
chmod +x $wrapper
|
||||
wrapProgram $out/bin/terranix-doc-json \
|
||||
--prefix PATH : ${lib.makeBinPath [ jq nix ]}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A NixOS like terraform-json generator";
|
||||
homepage = "https://terranix.org";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ mrVanDalo ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue