add examples and test VM

This commit is contained in:
2026-02-20 18:14:49 +01:00
parent df73fc25e6
commit 8868eb8736
12 changed files with 325 additions and 416 deletions

View File

@@ -1,30 +1,45 @@
# Simple Panoptikon configuration
{ pkgs, ... }:
{
services.panoptikon.enable = true;
services.panoptikon.watchers = {
# Monitor GitHub metadata every 5 minutes
github-meta = {
script = pkgs.writers.writeDash "github-meta" '''
${pkgs.curl}/bin/curl -sSL https://api.github.com/meta | ${pkgs.jq}/bin/jq
''';
script = pkgs.panoptikonWatchers.json { } "https://api.github.com/meta";
frequency = "*:0/5";
reporters = [
(pkgs.writers.writeDash "notify" '''
${pkgs.libnotify}/bin/notify-send "$PANOPTIKON_WATCHER has changed."
''')
(pkgs.panoptikonReporters.wall { })
(pkgs.panoptikonReporters.irc {
target = "kmein";
})
];
};
cock-canary = {
script = pkgs.panoptikonWatchers.plain "https://cock.li/canary.asc.txt";
frequency = "daily";
reporters = [
(pkgs.panoptikonReporters.irc {
target = "kmein";
})
];
};
"4d2-canary" = {
script = pkgs.panoptikonWatchers.plain "https://4d2.org/canary.txt";
frequency = "daily";
reporters = [
(pkgs.panoptikonReporters.irc {
target = "kmein";
})
];
};
# Monitor a website for news
nixos-news = {
script = pkgs.panoptikon.urlSelector "#news h2" "https://nixos.org/blog/";
script = pkgs.panoptikonWatchers.htmlSelector "article h2" "https://nixos.org/blog/";
frequency = "daily";
reporters = [
(pkgs.writers.writeDash "news-alert" '''
${pkgs.libnotify}/bin/notify-send "New NixOS blog post: $(cat | head -1)"
''')
(pkgs.panoptikonReporters.wall { })
];
};
};