diff --git a/nixos/components/terminal/zsh.nix b/nixos/components/terminal/zsh.nix index 1812860..7321b97 100644 --- a/nixos/components/terminal/zsh.nix +++ b/nixos/components/terminal/zsh.nix @@ -43,6 +43,19 @@ with lib; nix-show-garbadge-roots = "ls -lh /nix/var/nix/gcroots/auto/"; }; + interactiveShellInit = '' + kpaste() { + arg=cat + if [[ $# -ne 0 ]]; then + arg+=("''${@}") + elif [[ -t 0 ]] && [[ -o interactive ]]; then + arg=(wl-paste) + fi + "''${arg[@]}" | curl -sS http://p.r --data-binary @- | \ + sed '$ {p;s|http://p.r|https://p.krebsco.de|}' + } + ''; + }; };