diff options
author | Alan Pearce | 2020-03-02 15:08:44 +0100 |
---|---|---|
committer | Alan Pearce | 2020-03-02 15:08:44 +0100 |
commit | d820aae57b976d2fa935f48f18ac905ca0d5179e (patch) | |
tree | ec5f3d2536476cbd40bdccee7c701de912ec345a | |
parent | ba2104eb17f0727ac69dab9dbde0e6db045199bc (diff) | |
download | nixfiles-d820aae57b976d2fa935f48f18ac905ca0d5179e.tar.lz nixfiles-d820aae57b976d2fa935f48f18ac905ca0d5179e.tar.zst nixfiles-d820aae57b976d2fa935f48f18ac905ca0d5179e.zip |
zsh: precompile plugins
-rw-r--r-- | user/settings/zsh.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix index 0f97a227..5d62101a 100644 --- a/user/settings/zsh.nix +++ b/user/settings/zsh.nix @@ -4,6 +4,20 @@ let inherit (pkgs) stdenv; lsOptions = if stdenv.isDarwin then "-p" else "-v --group-directories-first"; lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso"; + mkZshPlugin = attrs: { + name = attrs.name; + src = stdenv.mkDerivation { + inherit (attrs) src; + name = "zsh-plugin-${attrs.name}"; + buildInputs = [ pkgs.zsh ]; + buildPhase = '' + zsh -c 'for f in **/*; zcompile "$f"' + ''; + installPhase = '' + cp -a $PWD $out/ + ''; + }; + }; in { home.packages = with pkgs; [ @@ -40,7 +54,7 @@ in ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=8"; }; - plugins = [ + plugins = (map mkZshPlugin [ { name = "cd-gitroot"; src = pkgs.fetchFromGitHub { @@ -112,7 +126,7 @@ in sha256 = "1328g3h51478ai25niv9qgf8bjgg3cw98zdqfznrbgw0k3qj66zk"; }; } - ]; + ]); shellAliases = { l = "ls ${lsOptions} -Bp"; |