2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, runtimeShell }:
|
2018-02-14 06:31:59 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zsh-autoenv";
|
2018-02-14 06:31:59 +00:00
|
|
|
version = "2017-12-16";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Tarrasch";
|
|
|
|
repo = "zsh-autoenv";
|
|
|
|
rev = "2c8cfbcea8e7286649840d7ec98d7e9d5e1d45a0";
|
|
|
|
sha256 = "004svkfzhc3ab6q2qvwzgj36wvicg5bs8d2gcibx6adq042di7zj";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ":";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share}
|
|
|
|
cp -R $src $out/share/zsh-autoenv
|
|
|
|
|
|
|
|
cat <<SCRIPT > $out/bin/zsh-autoenv-share
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2020-04-07 16:43:08 +01:00
|
|
|
# Run this script to find the zsh-autoenv shared folder where all the shell
|
2018-02-14 06:31:59 +00:00
|
|
|
# integration scripts are living.
|
|
|
|
echo $out/share/zsh-autoenv
|
|
|
|
SCRIPT
|
|
|
|
chmod +x $out/bin/zsh-autoenv-share
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-02-14 06:31:59 +00:00
|
|
|
description = "Automatically sources whitelisted .autoenv.zsh files";
|
|
|
|
longDescription = ''
|
|
|
|
zsh-autoenv automatically sources (known/whitelisted)
|
|
|
|
.autoenv.zsh files, typically used in project root directories.
|
|
|
|
It handles "enter" and "leave" events, nesting, and stashing of
|
|
|
|
variables (overwriting and restoring).
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/Tarrasch/zsh-autoenv";
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.all;
|
2018-02-14 06:31:59 +00:00
|
|
|
};
|
|
|
|
}
|