jungle/m/hut/p.nix

23 lines
393 B
Nix
Raw Permalink Normal View History

2024-09-16 16:33:42 +02:00
{ pkgs, ... }:
let
p = pkgs.writeShellScriptBin "p" ''
set -e
cd /ceph
pastedir="p/$USER"
mkdir -p "$pastedir"
if [ -n "$1" ]; then
out="$pastedir/$1"
else
out=$(mktemp "$pastedir/XXXXXXXX.txt")
fi
cat > "$out"
chmod go+r "$out"
echo "https://jungle.bsc.es/$out"
'';
in
{
environment.systemPackages = with pkgs; [ p ];
}