add kpaste

This commit is contained in:
Ingolf Wagner 2023-07-05 23:01:42 +02:00
parent 6aaecf4ac5
commit a03344046b
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -43,6 +43,19 @@ with lib;
nix-show-garbadge-roots = "ls -lh /nix/var/nix/gcroots/auto/"; 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|}'
}
'';
}; };
}; };