From 3c79a373e4744fc57497fedc9990efac6a0ae53b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 15 Feb 2024 16:32:37 +0000 Subject: [PATCH 1/2] pkgs: zsh-done: 0.1.0 -> 0.1.1 --- pkgs/zsh-done/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/zsh-done/default.nix b/pkgs/zsh-done/default.nix index bddc6c1..bdb6af3 100644 --- a/pkgs/zsh-done/default.nix +++ b/pkgs/zsh-done/default.nix @@ -2,13 +2,13 @@ stdenvNoCC.mkDerivation rec { pname = "zsh-done"; - version = "0.1.0"; + version = "0.1.1"; src = fetchFromGitHub { owner = "ambroisie"; repo = "zsh-done"; rev = "v${version}"; - hash = "sha256-DC7urJDXPP9vBYABrJF5KZ4HfMbrpHIVogSmEB8PWLA="; + hash = "sha256-dyhPhoMrAfDWtrBX5TA+B3G7QZ7gBhoDGNOEqGsCBQU="; }; dontConfigure = true; From a0dde6f27437c8e52c4f72187d8d3899cd90e30f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 15 Feb 2024 16:33:27 +0000 Subject: [PATCH 2/2] home: zsh: add notification exclusion list --- modules/home/zsh/default.nix | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index d983116..5bfeaee 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -19,6 +19,27 @@ in notify = { enable = mkEnableOption "zsh-done notification"; + exclude = mkOption { + type = with types; listOf str; + default = [ + "direnv reload" + "fg" + "git (?!push|pull|fetch)" + "htop" + "less" + "man" + "nvim" + "tail -f" + "tmux" + "vim" + ]; + example = [ "command --long-running-option" ]; + description = '' + List of exclusions which should not be create a notification. Accepts + Perl regexes (implicitly anchored with `^\s*`). + ''; + }; + ssh = { enable = mkEnableOption "notify through SSH/non-graphical connections"; @@ -116,10 +137,17 @@ in # `localVariables` values don't get merged correctly due to their type, # don't use `mkIf` - localVariables = { } - # Enable `zsh-done` through SSH, if configured - // lib.optionalAttrs cfg.notify.ssh.enable { DONE_ALLOW_NONGRAPHICAL = 1; } - ; + localVariables = { + DONE_EXCLUDE = + let + joined = lib.concatMapStringsSep "|" (c: "(${c})") cfg.notify.exclude; + in + ''^\s*(${joined})''; + } + # Enable `zsh-done` through SSH, if configured + // lib.optionalAttrs cfg.notify.ssh.enable { + DONE_ALLOW_NONGRAPHICAL = 1; + }; # Use OSC-777 to send the notification through SSH initExtra = lib.mkIf cfg.notify.ssh.useOsc777 ''