summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/sync-containers3.nix4
-rw-r--r--krebs/3modules/urlwatch.nix15
2 files changed, 13 insertions, 6 deletions
diff --git a/krebs/3modules/sync-containers3.nix b/krebs/3modules/sync-containers3.nix
index 4a00b23ab..ed147b30e 100644
--- a/krebs/3modules/sync-containers3.nix
+++ b/krebs/3modules/sync-containers3.nix
@@ -104,7 +104,9 @@ in {
consul lock sync_${ctr.name} ${pkgs.writers.writeDash "${ctr.name}-sync" ''
set -efux
if /run/wrappers/bin/ping -c 1 ${ctr.name}.r; then
- nice --adjustment=30 rsync -a -e "ssh -i $CREDENTIALS_DIRECTORY/ssh_key" --timeout=30 container_sync@${ctr.name}.r:disk "$HOME"/disk
+ nice --adjustment=30 rsync -a -e "ssh -i $CREDENTIALS_DIRECTORY/ssh_key" --timeout=30 --inplace --sparse container_sync@${ctr.name}.r:disk "$HOME"/disk.rsync
+ touch "$HOME"/incomplete
+ nice --adjustment=30 rsync --inplace "$HOME"/disk.rsync "$HOME"/disk
rm -f "$HOME"/incomplete
fi
''}
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;