diff options
-rw-r--r-- | home/zsh/default.nix | 1 | ||||
-rw-r--r-- | home/zsh/watch-while.nix | 25 | ||||
-rw-r--r-- | pkgs/default.nix | 2 | ||||
-rw-r--r-- | pkgs/watch-while/default.nix | 23 | ||||
-rw-r--r-- | pkgs/watch-while/watch-while.zsh | 24 |
5 files changed, 0 insertions, 75 deletions
diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 284812b..31796a9 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -2,7 +2,6 @@ imports = [ ./plugins.nix ./editing.nix - ./watch-while.nix ]; programs.zsh = { diff --git a/home/zsh/watch-while.nix b/home/zsh/watch-while.nix deleted file mode 100644 index ec42e13..0000000 --- a/home/zsh/watch-while.nix +++ /dev/null @@ -1,25 +0,0 @@ -# This module configures some ZSH aliases such that 'watch-while' is invoked -{ - pkgs, - lib, - ... -}: let - # Program to invoke for long-running commands. - pkg = pkgs.watch-while; - - # Prorams to wrap with watch-while. - toWrap = ["nixos-rebuild" "darwin-rebuild" "nmap"]; -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 toWrap (p: "${pkg}/bin/${pkg.pname} ${p}") - # Enable alias expansion after sudo with this trick. - // { - "sudo" = "sudo "; - "ww" = "watch-while "; - }; - - # Also add the program to the environment for manual invocation. - home.packages = [pkg]; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index d0dafaa..4737efb 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,8 +9,6 @@ pkgs: { mcping = pkgs.callPackage ./mcping {}; - watch-while = pkgs.callPackage ./watch-while {}; - # This is not wrapping the YaLafi python library, just a particular example # from the repo where they spellcheck LaTex files. yalafi-shell = pkgs.callPackage ./yalafi-shell {}; diff --git a/pkgs/watch-while/default.nix b/pkgs/watch-while/default.nix deleted file mode 100644 index fb29441..0000000 --- a/pkgs/watch-while/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - zsh, - mpv, - stdenvNoCC, -}: -stdenvNoCC.mkDerivation rec { - pname = "watch-while"; - version = "0.1.0"; - - src = ./watch-while.zsh; - unpackPhase = ":"; - - buildPhase = '' - substituteAll $src ${pname} - chmod +x ${pname} - ''; - inherit zsh mpv; - - installPhase = '' - mkdir -p $out/bin - mv ${pname} $out/bin/ - ''; -} diff --git a/pkgs/watch-while/watch-while.zsh b/pkgs/watch-while/watch-while.zsh deleted file mode 100644 index f483d15..0000000 --- a/pkgs/watch-while/watch-while.zsh +++ /dev/null @@ -1,24 +0,0 @@ -#!@zsh@/bin/zsh - -set -ue - -if [ $# -eq 0 ]; then - echo >&2 "Usage: $0 <command> [arg...]" - exit 1 -fi - -# This file should be a (symbolik link to a) file which we want to watch. -# TODO: Once we're finished with that movie, we just read the next. -movie=${XDG_CONFIG_HOME:-$HOME/.config}/watch-while/movie - -if [ -f $movie ] && ! [ -v NO_WATCH ]; then - @mpv@/bin/mpv --save-position-on-quit --autofit='90%x90%' -- $movie >/dev/null 2>&1 & - mpv_pid=$? - trap 'kill -s QUIT $mpv_pid' EXIT - - # We don't exec because we want our exit handler to fire. - "$@" || exit $? -else - # In this case where we don't have any movie we just transparently run the command. - exec "$@" -fi |