Remove drop-in config and use absolute paths in service file

Eliminate drop-in dependency by having install.sh replace
with absolute paths in the service file. EnvironmentFile loads vars from
.env directly.

Changes:
- Remove email_forwarder.service.d/ directory
- Update install.sh to sed service file for absolute paths
- Simplify README to rely on install.sh
This commit is contained in:
Jeena 2026-01-04 18:30:49 +09:00
parent c96bd8ed71
commit 701c8545a0
2 changed files with 2 additions and 20 deletions

View file

@ -1,14 +0,0 @@
# Sample systemd drop-in configuration for email_forwarder.service
# Copy this file to override.conf and customize the paths for your environment.
# For Linux: Set PROJECT_DIR to your project path, ENV_FILE to ./relative/path
# For NixOS: Set PROJECT_DIR to /var/lib/email_forwarder, ENV_FILE to /etc/email_forwarder/.env
[Service]
# Path to the email forwarder project directory
Environment=PROJECT_DIR=/path/to/your/email_forwarder
# Path to the .env file (default: ./.env relative to PROJECT_DIR)
Environment=ENV_FILE=./.env
# Load environment variables from the .env file
EnvironmentFile=${PROJECT_DIR}/.env

View file

@ -53,12 +53,8 @@ setup_systemd() {
# Copy service files
cp *.service *.timer "$HOME/.config/systemd/user/"
# Copy and configure drop-in
mkdir -p "$HOME/.config/systemd/user/email_forwarder.service.d"
cp email_forwarder.service.d/override.conf.sample "$HOME/.config/systemd/user/email_forwarder.service.d/override.conf"
# Replace placeholders
sed -i "s|/path/to/your/email_forwarder|$PROJECT_DIR|g" "$HOME/.config/systemd/user/email_forwarder.service.d/override.conf"
# Replace placeholders in service file
sed -i "s|\${PROJECT_DIR}|$PROJECT_DIR|g" "$HOME/.config/systemd/user/email_forwarder.service"
# Reload systemd
systemctl --user daemon-reload