Files
systemd/profile/profile-stats.service

22 lines
740 B
Desktop File

# lives at ~/.config/systemd/user/profile-stats.service
# User-level systemd service to run update_profile.py
# Configuration is via ~/.config/profile-stats.env, no in-file path edits needed.
# Create that file with one line:
# REPO_PATH=/absolute/path/to/this/repo
# Then run:
# systemctl --user daemon-reload
[Unit]
Description=Run update_profile.py (profile stats updater)
OnFailure=notify-gitea-failure@%n.service
[Service]
Type=oneshot
EnvironmentFile=%h/.config/profile-stats.env
ExecStartPre=/usr/bin/nm-online -q
ExecStartPre=/bin/bash -c 'for i in {1..30}; do getent hosts tildegit.org && exit 0; sleep 1; done; exit 1'
ExecStart=/bin/bash -lc 'cd ${REPO_PATH} && uv run language_stats.py'
[Install]
WantedBy=default.target