Merge pull request #145231 from thiagokokada/use-makewrapper-terranix

terranix: use wrapProgram on terranix-doc-json

authored by

Thiago Kenji Okada and committed by
GitHub
6c9ac6fb bf346b55

+6 -14
+6 -14
pkgs/applications/networking/cluster/terranix/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, jq, nix, ... }: 1 + { stdenv, lib, fetchFromGitHub, jq, nix, makeWrapper }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "terranix"; ··· 11 11 sha256 = "sha256-HDiyJGgyDUoLnpL8N+wDm3cM/vEfYYc/p4N1kKH/kLk="; 12 12 }; 13 13 14 + nativeBuildInputs = [ makeWrapper ]; 15 + 14 16 installPhase = '' 15 17 mkdir -p $out/{bin,core,modules,lib} 16 18 mv bin core modules lib $out/ 17 19 18 - mv $out/bin/terranix-doc-json $out/bin/.wrapper_terranix-doc-json 19 - 20 - # manual wrapper because makeWrapper expectes executables 21 - wrapper=$out/bin/terranix-doc-json 22 - cat <<EOF>$wrapper 23 - #!/usr/bin/env bash 24 - export PATH=$PATH:${jq}/bin:${nix}/bin 25 - $out/bin/.wrapper_terranix-doc-json "\$@" 26 - EOF 27 - chmod +x $wrapper 20 + wrapProgram $out/bin/terranix-doc-json \ 21 + --prefix PATH : ${lib.makeBinPath [ jq nix ]} 28 22 ''; 29 23 30 24 meta = with lib; { 31 25 description = "A NixOS like terraform-json generator"; 32 26 homepage = "https://terranix.org"; 33 27 license = licenses.gpl3; 34 - platforms = platforms.linux ++ platforms.darwin; 28 + platforms = platforms.unix; 35 29 maintainers = with maintainers; [ mrVanDalo ]; 36 30 }; 37 - 38 31 } 39 -