feat!: add linux cross-platform support with systemd unit file

This commit is contained in:
2025-06-23 03:48:44 -05:00
parent 0aba8b4bfa
commit a6a774aac7
7 changed files with 181 additions and 15 deletions

44
build/unix/HATray.service Normal file
View File

@@ -0,0 +1,44 @@
[Unit]
Description=HATray - Home Assistant Tray Utility
Documentation=https://github.com/Xevion/HATray
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
NotifyAccess=main
ExecStart=$BINARY_PATH
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
# CPUAccounting=yes
# MemoryAccounting=yes
# StandardOutput=journal
# StandardError=journal
# SyslogIdentifier=HATray
# Environment variables
# Environment=HOME=/home/%i
# Security settings
# NoNewPrivileges=true
# PrivateTmp=true
# ProtectSystem=strict
# ProtectHome=true
# ReadWritePaths=/home/%i/.config/HATray
# Resource limits (cgroups v2)
# MemoryMax=128M
# MemoryHigh=96M
# MemorySwapMax=0
# CPUQuota=10%
# CPUWeight=100
# IOWeight=100
# TasksMax=100
# LimitNOFILE=1024
# LimitCORE=0
[Install]
WantedBy=default.target