2021-11-07 08:43:34 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, jq, nix, ... }:
|
2020-09-26 19:15:57 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "terranix";
|
2021-11-07 08:43:34 +00:00
|
|
|
version = "2.5.0";
|
2020-09-26 19:15:57 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mrVanDalo";
|
|
|
|
repo = "terranix";
|
|
|
|
rev = version;
|
2021-11-07 08:43:34 +00:00
|
|
|
sha256 = "sha256-HDiyJGgyDUoLnpL8N+wDm3cM/vEfYYc/p4N1kKH/kLk=";
|
2020-09-26 19:15:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-11-07 08:43:34 +00:00
|
|
|
mkdir -p $out/{bin,core,modules,lib}
|
2020-09-26 19:15:57 +01:00
|
|
|
mv bin core modules lib $out/
|
2021-11-07 08:43:34 +00:00
|
|
|
|
|
|
|
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
|
2020-09-26 19:15:57 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-09-26 19:15:57 +01:00
|
|
|
description = "A NixOS like terraform-json generator";
|
|
|
|
homepage = "https://terranix.org";
|
|
|
|
license = licenses.gpl3;
|
2021-11-07 08:43:34 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-09-26 19:15:57 +01:00
|
|
|
maintainers = with maintainers; [ mrVanDalo ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|