stockholm/krebs/5pkgs/simple/cyberlocker-tools/default.nix

20 lines
412 B
Nix
Raw Normal View History

2021-08-29 12:00:18 +00:00
{ pkgs }:
pkgs.symlinkJoin {
name = "cyberlocker-tools";
paths = [
(pkgs.writers.writeDashBin "cput" ''
set -efu
path=''${1:-$(hostname)}
2021-08-29 12:00:18 +00:00
2021-08-31 17:26:37 +00:00
${pkgs.curl}/bin/curl -fSs --data-binary @- "http://c.r/$path"
2021-08-29 12:00:18 +00:00
echo "http://c.r/$path"
'')
(pkgs.writers.writeDashBin "cdel" ''
set -efu
path=$1
2021-08-31 17:26:37 +00:00
${pkgs.curl}/bin/curl -f -X DELETE "http://c.r/$path"
2021-08-29 12:00:18 +00:00
'')
];
}