initial commit
This commit is contained in:
31
examples/simple.nix
Normal file
31
examples/simple.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# 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)"
|
||||
''')
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user