diff options
author | Linnnus <[email protected]> | 2023-11-20 19:43:51 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-11-20 19:43:51 +0100 |
commit | 96fbb3074d44eb66f8ea31e2c9ba65264f6ad346 (patch) | |
tree | c89408b68f0286eb9c3961830f2f8ce0e782e947 /home | |
parent | 577c1db78cc74ae1e8ca6d3fc512e588d060436c (diff) |
home/watch-while: Add ww alias
Diffstat (limited to 'home')
-rw-r--r-- | home/zsh/watch-while.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/home/zsh/watch-while.nix b/home/zsh/watch-while.nix index d3d6422..87e2bbc 100644 --- a/home/zsh/watch-while.nix +++ b/home/zsh/watch-while.nix @@ -7,13 +7,19 @@ # Program to invoke for long-running commands. pkg = pkgs.watch-while; exec = "${pkg}/bin/watch-while"; + + # Prorams to wrap with watch-while. + toWrap = ["nixos-rebuild" "darwin-rebuild"]; in { # Alias long-running commands to their prefixed versions. These aliases are # only loaded for interactive use, so they won't mess with scripts. programs.zsh.shellAliases = - lib.genAttrs ["nixos-rebuild" "darwin-rebuild"] (p: "${exec} ${p}") + lib.genAttrs toWrap (p: "${exec} ${p}") # Enable alias expansion after sudo with this trick. - // {"sudo" = "sudo ";}; + // { + "sudo" = "sudo "; + "ww" = "watch-while "; + }; # Also add the program to the environment for manual invocation. home.packages = [pkg]; |