tv urlwatch: add exec

This commit is contained in:
tv 2019-08-13 00:02:54 +02:00
parent f319d31e36
commit 8527caef16

View File

@ -1,19 +1,15 @@
with import <stockholm/lib>; with import <stockholm/lib>;
{ config, pkgs, ... }: let { config, pkgs, ... }: let
exec = filename: args: url: {
inherit url;
filter = "system:${
concatMapStringsSep " " shell.escape ([filename] ++ toList args)
}";
};
json = json' ["."]; json = json' ["."];
json' = args: url: { json' = exec "${pkgs.jq}/bin/jq";
inherit url;
filter = "system:${pkgs.jq}/bin/jq ${
concatMapStringsSep " " shell.escape (toList args)
}";
};
xml = xml' ["--format" "-"]; xml = xml' ["--format" "-"];
xml' = args: url: { xml' = exec "${pkgs.libxml2}/bin/xmllint";
inherit url;
filter = "system:${pkgs.libxml2}/bin/xmllint ${
concatMapStringsSep " " shell.escape (toList args)
}";
};
in { in {
krebs.urlwatch = { krebs.urlwatch = {
enable = true; enable = true;