From d46b38c3897b568e6e0f4e98a042073e34f2f566 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 8 Dec 2019 23:59:16 -0500 Subject: [PATCH] Move zsh/zgen setup to .zshenv --- config/zsh/.zshenv | 9 +++++++++ modules/shell/zsh.nix | 14 ++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config/zsh/.zshenv b/config/zsh/.zshenv index 2c5acda7..f1ef19b8 100644 --- a/config/zsh/.zshenv +++ b/config/zsh/.zshenv @@ -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 export PATH="$dir:$PATH" done diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index 2f6bbcaf..feee3ab8 100644 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -1,16 +1,7 @@ { config, pkgs, libs, ... }: -let zgen = builtins.fetchGit "https://github.com/tarjoilija/zgen"; -in { 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; [ zsh nix-zsh-completions @@ -35,6 +26,9 @@ in home-manager.users.hlissner.xdg.configFile = { # link recursively so other modules can link files in this folder, # particularly in zsh/rc.d/*.zsh - "zsh" = { source = ; recursive = true; }; + "zsh" = { + source = ; + recursive = true; + }; }; }