It would be really cool to have a options like:
system.loginItems = [ "AppName.app" ]
# or
system.defaults = {
loginItems = [ "AppName.app" ]
}
that take a list of app paths and manages them declaratively via the macOS Login Items API
The current workaround requires a home-manager activationScript with raw osascript, which is brittle and not discoverable:
home.activation.loginItems = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run /usr/bin/osascript <<'EOF'
tell application "System Events"
delete every login item
set appPaths to {"/Applications/AppName.app"}
repeat with appPath in appPaths
make login item at end with properties {path:appPath, hidden:false}
end repeat
end tell
EOF
'';
It would be really cool to have a options like:
that take a list of app paths and manages them declaratively via the macOS Login Items API
The current workaround requires a home-manager activationScript with raw osascript, which is brittle and not discoverable: