fix: bake STACKS_DIR into systemd service units at install time

The update and backup services ran without STACKS_DIR since systemd
doesn't source ~/.env or ~/.zshrc. Capture the value at install time
and write it as Environment= in the generated unit files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 19:12:31 +02:00
co-authored by Claude Sonnet 4.6
parent 1bfea393da
commit bf396972b0
+2
View File
@@ -475,6 +475,7 @@ Type=oneshot
User=root User=root
ExecStart=${_self} update run ExecStart=${_self} update run
Environment=HOME=/root Environment=HOME=/root
Environment=STACKS_DIR=${STACKS_DIR}
EOF EOF
cat > /etc/systemd/system/stacks-update.timer << 'EOF' cat > /etc/systemd/system/stacks-update.timer << 'EOF'
[Unit] [Unit]
@@ -632,6 +633,7 @@ Type=oneshot
User=root User=root
ExecStart=${_self} backup run ExecStart=${_self} backup run
Environment=HOME=/root Environment=HOME=/root
Environment=STACKS_DIR=${STACKS_DIR}
EOF EOF
cat > /etc/systemd/system/stacks-backup.timer << 'EOF' cat > /etc/systemd/system/stacks-backup.timer << 'EOF'
[Unit] [Unit]