From 1379ece72106f5e15856e72ce9d40ebc938d15d3 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 9 Jul 2021 11:48:54 +0200 Subject: zsh: add shmart-prompt-dir --- common/commandline/zsh.nix | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'common/commandline') diff --git a/common/commandline/zsh.nix b/common/commandline/zsh.nix index 56bdbac..2fc8c87 100644 --- a/common/commandline/zsh.nix +++ b/common/commandline/zsh.nix @@ -21,6 +21,9 @@ in local dim_fg_escape_code="${fgEscapeCode config.theme.colors.dimForeground}" ${builtins.readFile ../../dotfiles/zshrc} + + autoload -Uz shmart-prompt-dir + zstyle -e ':prompt:grml*:*:items:path' token shmart-prompt-dir } # Grml's ZSH config overrides less variables @@ -57,17 +60,27 @@ in users.defaultUserShell = pkgs.zsh; - home-manager.users.minijackson = { ... }: { - # Allows zsh config from home-manager - programs.zsh = { - enable = true; - # Completion is already handled by the GRML conf - enableCompletion = false; - }; - }; + home-manager.users = + let + config = { + enable = true; + # Completion is already handled by the GRML conf + enableCompletion = false; - home-manager.users.root = { ... }: { - programs.zsh = - lib.mkDefault config.home-manager.users.minijackson.programs.zsh; - }; + plugins = [{ + name = "shmart-prompt-dir"; + src = inputs.shmart-prompt-dir; + file = "none"; + }]; + }; + in + { + minijackson = { ... }: { + # Allows zsh config from home-manager + programs.zsh = config; + }; + root = { ... }: { + programs.zsh = config; + }; + }; } -- cgit v1.2.3