all repos — nixfiles @ d820aae57b976d2fa935f48f18ac905ca0d5179e

System and user configuration, managed by nix and home-manager

zsh: precompile plugins

Alan Pearce
commit

d820aae57b976d2fa935f48f18ac905ca0d5179e

parent

ba2104eb17f0727ac69dab9dbde0e6db045199bc

1 file changed, 16 insertions(+), 2 deletions(-)

jump to
M user/settings/zsh.nixuser/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 @@ localVariables = {
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=8"; }; - plugins = [ + plugins = (map mkZshPlugin [ { name = "cd-gitroot"; src = pkgs.fetchFromGitHub {
@@ -112,7 +126,7 @@ # date = 2019-03-07T08:53:24-07:00;
sha256 = "1328g3h51478ai25niv9qgf8bjgg3cw98zdqfznrbgw0k3qj66zk"; }; } - ]; + ]); shellAliases = { l = "ls ${lsOptions} -Bp";