home: use selfhosted wastebin

This commit is contained in:
Guanran Wang 2024-06-05 17:51:01 +08:00
parent b6826c238e
commit 9d33f42d3f
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF

View file

@ -57,4 +57,15 @@
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
};
programs.fish.functions = {
"pb" = let
jq = lib.getExe pkgs.jq;
curl = lib.getExe pkgs.curl;
in ''
${jq} -Rns '{text: inputs}' | \
${curl} -s -H 'Content-Type: application/json' --data-binary @- https://pb.ny4.dev | \
${jq} -r '. | "https://pb.ny4.dev\(.path)"'
'';
};
}