summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/urlwatch.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-02-04 11:16:17 +0100
committermakefu <github@syntax-fehler.de>2016-02-04 11:16:17 +0100
commite89f43de944af3751b7a70de87e3cc0c1860f2bd (patch)
tree15401006a9cc87971f43d9c58e4e4ea5da522040 /krebs/3modules/urlwatch.nix
parentcc1a230fd2742b6ccadd0837d9cf569f246375aa (diff)
parent307e0afe851654e07e0c3fca25adf60ada3d974d (diff)
Merge 'cd/master' - update krebs.build.source
Diffstat (limited to 'krebs/3modules/urlwatch.nix')
-rw-r--r--krebs/3modules/urlwatch.nix46
1 files changed, 44 insertions, 2 deletions
diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix
index 31cbfcf6e..7a9fb55fd 100644
--- a/krebs/3modules/urlwatch.nix
+++ b/krebs/3modules/urlwatch.nix
@@ -54,6 +54,10 @@ let
example = [
https://nixos.org/channels/nixos-unstable/git-revision
];
+ apply = map (x: getAttr (typeOf x) {
+ set = x;
+ string.url = x;
+ });
};
verbose = mkOption {
type = types.bool;
@@ -64,7 +68,40 @@ let
};
};
- urlsFile = toFile "urls" (concatStringsSep "\n" cfg.urls);
+ urlsFile = toFile "urls" (concatMapStringsSep "\n---\n" toJSON cfg.urls);
+
+ configFile = toFile "urlwatch.yaml" (toJSON {
+ display = {
+ error = true;
+ new = true;
+ unchanged = false;
+ };
+ report = {
+ email = {
+ enabled = false;
+ from = "";
+ html = false;
+ smtp = {
+ host = "localhost";
+ keyring = true;
+ port = 25;
+ starttls = true;
+ };
+ subject = "{count} changes: {jobs}";
+ to = "";
+ };
+ html.diff = "unified";
+ stdout = {
+ color = true;
+ enabled = true;
+ };
+ text = {
+ details = true;
+ footer = true;
+ line_length = 75;
+ };
+ };
+ });
imp = {
systemd.timers.urlwatch = {
@@ -109,10 +146,15 @@ let
from=${escapeShellArg cfg.from}
mailto=${escapeShellArg cfg.mailto}
urlsFile=${escapeShellArg urlsFile}
+ configFile=${escapeShellArg configFile}
cd /tmp
- urlwatch -e ${optionalString cfg.verbose "-v"} --urls="$urlsFile" > changes || :
+ urlwatch \
+ ${optionalString cfg.verbose "-v"} \
+ --urls="$urlsFile" \
+ --config="$configFile" \
+ > changes || :
if test -s changes; then
date=$(date -R)