summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-06-08 04:56:25 +0200
committerlassulus <lass@blue.r>2018-06-08 04:56:25 +0200
commit3f2b46087481b79281901302896e903261ec71a5 (patch)
tree31bc9cf51e89f8292f6665c032d7af1230b0df1a /krebs/5pkgs/simple
parentc9615eed5383a7b896e3be2c9b56f9c48135677f (diff)
Reaktor plugins: add todo plugin generator
Diffstat (limited to 'krebs/5pkgs/simple')
-rw-r--r--krebs/5pkgs/simple/Reaktor/plugins.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix
index 52e080625..c39e39799 100644
--- a/krebs/5pkgs/simple/Reaktor/plugins.nix
+++ b/krebs/5pkgs/simple/Reaktor/plugins.nix
@@ -141,5 +141,27 @@ rec {
'';
});
+ todo = name: {
+ add = buildSimpleReaktorPlugin "${name}-add" {
+ pattern = "^${name}-add: (?P<args>.*)$$";
+ script = pkgs.writeDash "${name}-add" ''
+ echo "$*" >> ${name}-todo
+ echo "added ${name} todo"
+ '';
+ };
+ delete = buildSimpleReaktorPlugin "${name}-delete" {
+ pattern = "^${name}-delete: (?P<args>.*)$$";
+ script = pkgs.writeDash "${name}-delete" ''
+ ${pkgs.gnugrep}/bin/grep -Fvxe "$*" ${name}-todo > ${name}-todo.tmp
+ ${pkgs.coreutils}/bin/mv ${name}-todo.tmp ${name}-todo
+ echo "removed ${name} todo: $*"
+ '';
+ };
+ show = buildSimpleReaktorPlugin "${name}-show" {
+ pattern = "^${name}-show$";
+ script = pkgs.writeDash "${name}-show" ''
+ ${pkgs.coreutils}/bin/cat ${name}-todo
+ '';
+ };
};
}