Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

50 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;
};
})