summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krebs/3modules/urlwatch.nix44
-rw-r--r--tv/1systems/mu/config.nix7
-rw-r--r--tv/2configs/sshd.nix6
3 files changed, 38 insertions, 19 deletions
diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix
index 0cec1a2d3..3c9ff7709 100644
--- a/krebs/3modules/urlwatch.nix
+++ b/krebs/3modules/urlwatch.nix
@@ -17,6 +17,8 @@ let
api = {
enable = mkEnableOption "krebs.urlwatch";
+ customSendmail.enable = mkEnableOption "krebs.urlwatch.customSendmail";
+
dataDir = mkOption {
type = types.str;
default = "/var/lib/urlwatch";
@@ -54,6 +56,15 @@ let
The format is described in systemd.time(7), CALENDAR EVENTS.
'';
};
+ telegram = {
+ enable = mkEnableOption "krebs.urlwatch.telegram" // { default = false; };
+ botToken = mkOption {
+ type = types.str;
+ };
+ chatId = mkOption {
+ type = types.listOf types.str;
+ };
+ };
urls = mkOption {
type = with types; listOf (either str subtypes.job);
default = [];
@@ -110,6 +121,11 @@ let
color = true;
enabled = true;
};
+ ${if cfg.telegram.enable then "telegram" else null} = {
+ enabled = cfg.telegram.enable;
+ bot_token = cfg.telegram.botToken;
+ chat_id = cfg.telegram.chatId;
+ };
text = {
details = true;
footer = true;
@@ -158,19 +174,21 @@ let
--urls=${shell.escape urlsFile} \
> changes || :
- if test -s changes; then
- {
- echo Date: $(date -R)
- echo From: ${shell.escape cfg.from}
- echo Subject: $(
- sed -n 's/^\(CHANGED\|ERROR\|NEW\): //p' changes \
- | tr '\n' ' '
- )
- echo To: ${shell.escape cfg.mailto}
- echo
- cat changes
- } | /run/wrappers/bin/sendmail -t
- fi
+ ${optionalString cfg.customSendmail.enable /* sh */ ''
+ if test -s changes; then
+ {
+ echo Date: $(date -R)
+ echo From: ${shell.escape cfg.from}
+ echo Subject: $(
+ sed -n 's/^\(CHANGED\|ERROR\|NEW\): //p' changes \
+ | tr '\n' ' '
+ )
+ echo To: ${shell.escape cfg.mailto}
+ echo
+ cat changes
+ } | /run/wrappers/bin/sendmail -t
+ fi
+ ''}
'';
};
};
diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix
index f1cd7d673..98332b2d6 100644
--- a/tv/1systems/mu/config.nix
+++ b/tv/1systems/mu/config.nix
@@ -49,6 +49,13 @@ with import <stockholm/lib>;
networking.networkmanager.enable = true;
+ # XXX reload to work around occasional "Failed to load firmware chunk!"
+ # TODO only do this if firmware is actually broken(?)
+ system.activationScripts.reload-iwlwifi = /* sh */ ''
+ ${pkgs.kmod}/bin/modprobe -vr iwlwifi
+ ${pkgs.kmod}/bin/modprobe -v iwlwifi
+ '';
+
environment.systemPackages = with pkgs; [
chromium
firefoxWrapper
diff --git a/tv/2configs/sshd.nix b/tv/2configs/sshd.nix
index 1749b552d..25468f23e 100644
--- a/tv/2configs/sshd.nix
+++ b/tv/2configs/sshd.nix
@@ -5,12 +5,6 @@ with import <stockholm/lib>;
{
services.openssh = {
enable = true;
- hostKeys = [
- {
- type = "ed25519";
- path = "/etc/ssh/ssh_host_ed25519_key";
- }
- ];
};
tv.iptables.input-internet-accept-tcp = singleton "ssh";
}