Move zsh/zgen setup to .zshenv

This commit is contained in:
Henrik Lissner 2019-12-08 23:59:16 -05:00
parent ee84fa45a2
commit d46b38c389
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 13 additions and 10 deletions

View file

@ -1,3 +1,12 @@
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export ZSH_CACHE="$XDG_CACHE_HOME/zsh"
export ZGEN_DIR="$XDG_CACHE_HOME/zgen"
export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh"
if [[ ! -d "$ZGEN_SOURCE" ]]; then
git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
fi
for dir in $XDG_CONFIG_HOME/*/bin(N); do for dir in $XDG_CONFIG_HOME/*/bin(N); do
export PATH="$dir:$PATH" export PATH="$dir:$PATH"
done done

View file

@ -1,16 +1,7 @@
{ config, pkgs, libs, ... }: { config, pkgs, libs, ... }:
let zgen = builtins.fetchGit "https://github.com/tarjoilija/zgen";
in
{ {
environment = { environment = {
variables = {
ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
ZGEN_DIR = "$XDG_CACHE_HOME/zgen";
ZGEN_SOURCE = "${zgen}/zgen.zsh";
};
systemPackages = with pkgs; [ systemPackages = with pkgs; [
zsh zsh
nix-zsh-completions nix-zsh-completions
@ -35,6 +26,9 @@ in
home-manager.users.hlissner.xdg.configFile = { home-manager.users.hlissner.xdg.configFile = {
# link recursively so other modules can link files in this folder, # link recursively so other modules can link files in this folder,
# particularly in zsh/rc.d/*.zsh # particularly in zsh/rc.d/*.zsh
"zsh" = { source = <config/zsh>; recursive = true; }; "zsh" = {
source = <config/zsh>;
recursive = true;
};
}; };
} }