summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/cyberlocker-tools/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-09-05 18:22:38 +0200
committermakefu <github@syntax-fehler.de>2021-09-05 18:22:38 +0200
commit3299706b01ea1431769e9e017c4d639e673ec1d2 (patch)
treefc717c0bbd76a4d6be3630e55beb5311bcf15877 /krebs/5pkgs/simple/cyberlocker-tools/default.nix
parent5c570ab3fc90ca689a9f01c0bffd2470130738ba (diff)
parentc7db9e13cde6ba34afd863d0f9e77410c194039c (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/cyberlocker-tools/default.nix')
-rw-r--r--krebs/5pkgs/simple/cyberlocker-tools/default.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/cyberlocker-tools/default.nix b/krebs/5pkgs/simple/cyberlocker-tools/default.nix
new file mode 100644
index 000000000..6e6563fb1
--- /dev/null
+++ b/krebs/5pkgs/simple/cyberlocker-tools/default.nix
@@ -0,0 +1,23 @@
+{ pkgs }:
+pkgs.symlinkJoin {
+ name = "cyberlocker-tools";
+ paths = [
+ (pkgs.writers.writeDashBin "cput" ''
+ set -efu
+ path=''${1:-$(hostname)}
+ path=$(echo "/$path" | sed -E 's:/+:/:')
+ url=http://c.r$path
+
+ ${pkgs.curl}/bin/curl -fSs --data-binary @- "$url"
+ echo "$url"
+ '')
+ (pkgs.writers.writeDashBin "cdel" ''
+ set -efu
+ path=$1
+ path=$(echo "/$path" | sed -E 's:/+:/:')
+ url=http://c.r$path
+
+ ${pkgs.curl}/bin/curl -f -X DELETE "$url"
+ '')
+ ];
+}