depot/third_party/nixpkgs/pkgs/by-name/ba/bash-env-json/package.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

49 lines
1.5 KiB
Nix

{
stdenvNoCC,
lib,
fetchFromGitHub,
coreutils,
gnused,
jq,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "bash-env-json";
version = "0.10.1";
src = fetchFromGitHub {
owner = "tesujimath";
repo = "bash-env-json";
rev = finalAttrs.version;
hash = "sha256-gyqj5r11DOfXd23LT7qwRLEoWvpHUbxbd28QJnlWTaQ=";
};
installPhase = ''
runHook preInstall
install -Dm755 bash-env-json -t $out/bin
runHook postInstall
'';
postFixup = ''
substituteInPlace $out/bin/bash-env-json --replace-fail " env " " ${lib.getExe' coreutils "env"} "
substituteInPlace $out/bin/bash-env-json --replace-fail " jq " " ${lib.getExe jq} "
substituteInPlace $out/bin/bash-env-json --replace-fail " mktemp " " ${lib.getExe' coreutils "mktemp"} "
substituteInPlace $out/bin/bash-env-json --replace-fail " rm " " ${lib.getExe' coreutils "rm"} "
substituteInPlace $out/bin/bash-env-json --replace-fail " sed " " ${lib.getExe gnused} "
substituteInPlace $out/bin/bash-env-json --replace-fail " touch " " ${lib.getExe' coreutils "touch"} "
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Export Bash environment as JSON for import into modern shells like Elvish and Nushell";
homepage = "https://github.com/tesujimath/bash-env-json";
mainProgram = "bash-env-json";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jaredmontoya ];
platforms = lib.platforms.all;
};
})