zsh-autoenv: init at 2017-12-16 (#34932)
This commit is contained in:
parent
c2973f986d
commit
6d442efe99
@ -114,6 +114,7 @@
|
|||||||
./programs/yabar.nix
|
./programs/yabar.nix
|
||||||
./programs/zsh/oh-my-zsh.nix
|
./programs/zsh/oh-my-zsh.nix
|
||||||
./programs/zsh/zsh.nix
|
./programs/zsh/zsh.nix
|
||||||
|
./programs/zsh/zsh-autoenv.nix
|
||||||
./programs/zsh/zsh-syntax-highlighting.nix
|
./programs/zsh/zsh-syntax-highlighting.nix
|
||||||
./rename.nix
|
./rename.nix
|
||||||
./security/acme.nix
|
./security/acme.nix
|
||||||
|
28
nixos/modules/programs/zsh/zsh-autoenv.nix
Normal file
28
nixos/modules/programs/zsh/zsh-autoenv.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.zsh.zsh-autoenv;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
programs.zsh.zsh-autoenv = {
|
||||||
|
enable = mkEnableOption "zsh-autoenv";
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.zsh-autoenv;
|
||||||
|
defaultText = "pkgs.zsh-autoenv";
|
||||||
|
description = ''
|
||||||
|
Package to install for `zsh-autoenv` usage.
|
||||||
|
'';
|
||||||
|
|
||||||
|
type = types.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.zsh.interactiveShellInit = ''
|
||||||
|
source ${cfg.package}/share/zsh-autoenv/autoenv.zsh
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
40
pkgs/tools/misc/zsh-autoenv/default.nix
Normal file
40
pkgs/tools/misc/zsh-autoenv/default.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{ stdenv, fetchFromGitHub, bash }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "zsh-autoenv-${version}";
|
||||||
|
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
|
||||||
|
#!${stdenv.shell}
|
||||||
|
# Run this script to find the fzf 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 stdenv.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;
|
||||||
|
};
|
||||||
|
}
|
@ -5550,6 +5550,8 @@ with pkgs;
|
|||||||
zpaq = callPackage ../tools/archivers/zpaq { };
|
zpaq = callPackage ../tools/archivers/zpaq { };
|
||||||
zpaqd = callPackage ../tools/archivers/zpaq/zpaqd.nix { };
|
zpaqd = callPackage ../tools/archivers/zpaq/zpaqd.nix { };
|
||||||
|
|
||||||
|
zsh-autoenv = callPackage ../tools/misc/zsh-autoenv { };
|
||||||
|
|
||||||
zsh-git-prompt = callPackage ../shells/zsh-git-prompt { };
|
zsh-git-prompt = callPackage ../shells/zsh-git-prompt { };
|
||||||
|
|
||||||
zsh-navigation-tools = callPackage ../tools/misc/zsh-navigation-tools { };
|
zsh-navigation-tools = callPackage ../tools/misc/zsh-navigation-tools { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user