Files
panoptikon/examples/simple.nix

32 lines
878 B
Nix
Raw Normal View History

2026-02-20 17:22:14 +01:00
# Simple Panoptikon configuration
{
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
''';
frequency = "*:0/5";
reporters = [
(pkgs.writers.writeDash "notify" '''
${pkgs.libnotify}/bin/notify-send "$PANOPTIKON_WATCHER has changed."
''')
];
};
# Monitor a website for news
nixos-news = {
script = pkgs.panoptikon.urlSelector "#news 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)"
''')
];
};
};
}