4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{ lib, stdenv, fetchFromGitHub, runtimeShell }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "zsh-autoenv";
|
|
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
|
|
#!${runtimeShell}
|
|
# Run this script to find the zsh-autoenv shared folder where all the shell
|
|
# integration scripts are living.
|
|
echo $out/share/zsh-autoenv
|
|
SCRIPT
|
|
chmod +x $out/bin/zsh-autoenv-share
|
|
'';
|
|
|
|
meta = with lib; {
|
|
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).
|
|
'';
|
|
homepage = "https://github.com/Tarrasch/zsh-autoenv";
|
|
platforms = stdenv.lib.platforms.all;
|
|
};
|
|
}
|