chore: add env-based REPO_PATH config for libguides-notifier.service

Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
This commit is contained in:
Mark Eaton
2025-11-16 01:41:06 -05:00
co-authored by aider
parent 48e6ff9645
commit c14a8ab724
+7 -7
View File
@@ -1,11 +1,10 @@
# User-level systemd service to run main.py # User-level systemd service to run main.py
# Uses a wrapper script so the working directory and .env are found correctly. # Uses a wrapper script so the working directory and .env are found correctly.
# Replace REPO_PATH automatically using the setup command we provide. # Configuration is via ~/.config/libguides-notifier.env, no in-file path edits needed.
# Install step 2 does three things: # Create that file with one line:
# - Replaces REPO_PATH with your repos absolute path in the COPY of this unit at ~/.config/systemd/user/ # REPO_PATH=/absolute/path/to/this/repo
# so ExecStart points to the correct scripts/run_main.sh. # Then run:
# - Marks scripts/run_main.sh as executable (chmod +x). # systemctl --user daemon-reload
# - Reloads user units (systemctl --user daemon-reload) so systemd picks up the updated service/timer.
[Unit] [Unit]
Description=Run main.py (LibGuides notifier) Description=Run main.py (LibGuides notifier)
Wants=network-online.target Wants=network-online.target
@@ -13,7 +12,8 @@ After=network-online.target
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart="REPO_PATH/scripts/run_main.sh" EnvironmentFile=%h/.config/libguides-notifier.env
ExecStart="${REPO_PATH}/scripts/run_main.sh"
[Install] [Install]
WantedBy=default.target WantedBy=default.target