Skip to content

Instantly share code, notes, and snippets.

@InternetUnexplorer
Last active February 18, 2021 04:28
Show Gist options
  • Save InternetUnexplorer/32afbf1c1cc862c62c7107ff10cb069f to your computer and use it in GitHub Desktop.
Save InternetUnexplorer/32afbf1c1cc862c62c7107ff10cb069f to your computer and use it in GitHub Desktop.
Systemd timer/service file and hooks for nix-channel-watcher
#! /usr/bin/env bash
REPOSITORY=InternetUnexplorer/kwin-lowlatency-overlay
set -eu
source .secrets
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "{\"event_type\": \"Build: $1@${3:0:10}\", \"client_payload\": {\"channel\": \"$1\"}}" \
https://api.github.com/repos/$REPOSITORY/dispatches
[Unit]
Description=check for Nix channel updates
[Service]
Type=oneshot
User=nix-channel-watcher
ExecStart=/var/lib/nix-channel-watcher/channel-watcher.py
WorkingDirectory=/var/lib/nix-channel-watcher
TimeoutSec=30
[Unit]
Description=check for Nix channel updates every two minutes
[Timer]
OnCalendar=*:0/2
AccuracySec=15
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment