summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/urlwatch.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-03-08 19:27:59 +0100
committermakefu <github@syntax-fehler.de>2023-03-08 19:27:59 +0100
commitcaa8f83e79f7373bf234874b8614117c3f7a0710 (patch)
tree9167f06d093d44a662536aa4b5e3d32c271ccca0 /krebs/3modules/urlwatch.nix
parent8b4c488bff6b61e2e3ed7c75d96b161a66f5a8c4 (diff)
parent2168f3961298b661fd010add7972a86af77f81de (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules/urlwatch.nix')
-rw-r--r--krebs/3modules/urlwatch.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix
index 2e336de21..113f6e65d 100644
--- a/krebs/3modules/urlwatch.nix
+++ b/krebs/3modules/urlwatch.nix
@@ -71,7 +71,7 @@ let
description = "URL to watch.";
example = [
https://nixos.org/channels/nixos-unstable/git-revision
- { url = http://localhost ; filter = "grep:important.*stuff"; }
+ { url = http://localhost ; filter = [ (grep "important.*stuff") ]; }
];
apply = map (x: getAttr (typeOf x) {
set = x;
@@ -177,12 +177,15 @@ let
echo Date: $(date -R)
echo From: ${shell.escape cfg.from}
echo Subject: $(
- sed -n 's/^\(CHANGED\|ERROR\|NEW\): //p' changes \
- | tr '\n' ' '
+ sed -nr 's/^(CHANGED|ERROR|NEW): //p' changes |
+ sed '1!s/^ //'
)
echo To: ${shell.escape cfg.mailto}
+ echo Mime-Version: 1.0
+ echo Content-Type: text/plain\; charset=UTF-8
+ echo Content-Transfer-Encoding: base64
echo
- cat changes
+ base64 changes
} | /run/wrappers/bin/sendmail -t
fi
''}
@@ -211,7 +214,9 @@ let
};
filter = mkOption {
default = null;
- type = with types; nullOr str; # TODO nullOr subtypes.filter
+ type =
+ with types;
+ nullOr (either str (listOf (pkgs.formats.json {}).type));
};
ignore_cached = mkOption {
default = null;