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 +++++++++++++++++++++++++------------ flake.lock | 19 ++++++++++++++++++- flake.nix | 4 ++++ 3 files changed, 47 insertions(+), 13 deletions(-) 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; + }; + }; } diff --git a/flake.lock b/flake.lock index d9544bb..de1e3c0 100644 --- a/flake.lock +++ b/flake.lock @@ -106,7 +106,24 @@ "musnix": "musnix", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", - "nur": "nur" + "nur": "nur", + "shmart-prompt-dir": "shmart-prompt-dir" + } + }, + "shmart-prompt-dir": { + "flake": false, + "locked": { + "lastModified": 1625823847, + "narHash": "sha256-aPI9XAX1/KXOHZ/ADxa4ChI0BQdiWfSH57CE27EFOyA=", + "owner": "minijackson", + "repo": "shmart-prompt-dir", + "rev": "5fdd49c8b901b6861879e61cca7244af0405bb8e", + "type": "github" + }, + "original": { + "owner": "minijackson", + "repo": "shmart-prompt-dir", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 6d014e9..d25a4a4 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ url = "github:musnix/musnix"; flake = false; }; + inputs.shmart-prompt-dir = { + url = "github:minijackson/shmart-prompt-dir"; + flake = false; + }; outputs = inputs @ { self, nixpkgs, home-manager, ... }: { -- cgit v1.2.3