urlwatch: optionalise custom sendmail
This commit is contained in:
parent
1d23dceb5d
commit
41a4936144
@ -17,6 +17,8 @@ let
|
|||||||
api = {
|
api = {
|
||||||
enable = mkEnableOption "krebs.urlwatch";
|
enable = mkEnableOption "krebs.urlwatch";
|
||||||
|
|
||||||
|
customSendmail.enable = mkEnableOption "krebs.urlwatch.customSendmail";
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/var/lib/urlwatch";
|
default = "/var/lib/urlwatch";
|
||||||
@ -158,6 +160,7 @@ let
|
|||||||
--urls=${shell.escape urlsFile} \
|
--urls=${shell.escape urlsFile} \
|
||||||
> changes || :
|
> changes || :
|
||||||
|
|
||||||
|
${optionalString cfg.customSendmail.enable /* sh */ ''
|
||||||
if test -s changes; then
|
if test -s changes; then
|
||||||
{
|
{
|
||||||
echo Date: $(date -R)
|
echo Date: $(date -R)
|
||||||
@ -171,6 +174,7 @@ let
|
|||||||
cat changes
|
cat changes
|
||||||
} | /run/wrappers/bin/sendmail -t
|
} | /run/wrappers/bin/sendmail -t
|
||||||
fi
|
fi
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user