LnL7 / nix-darwin

nix modules for darwin
MIT License
3.18k stars 457 forks source link

Enable brew services program args #708

Open jmatsushita opened 1 year ago

jmatsushita commented 1 year ago

I'm setting up https://github.com/Dimentium/homebrew-autoraise and this works great:

  brews = [ 
    {
      name = "autoraise";
      restart_service = true;
    }
  ];

However, I'd like to be able to setup command line arguments for the service such as https://github.com/sbmpost/AutoRaise/blob/bb65873c19e0a030ebee6364c83c3c33cd1f736c/README.md?plain=1#L70-L72

Would you consider adding a homebrew.brews.*.serviceConfig.ProgramArguments to modify the homebrew .plist file's arguments as described here?

> more ~/Library/LaunchAgents/homebrew.mxcl.autoraise.plist                                                                                    ~/dev/workshop/iios
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.autoraise</string>
    <key>ProgramArguments</key>
    <array>
    <string>/opt/homebrew/opt/autoraise/bin/AutoRaise</string>
    </array>
    <key>StandardErrorPath</key>
    <string>/Users/jun/Library/Logs/AutoRaise.log</string>
    <key>StandardOutPath</key>
    <string>/Users/jun/Library/Logs/AutoRaise.log</string>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>
jmatsushita commented 1 year ago

On second thought, I might not use this and prefer to use a ~/.config/AutoRaise/config. Feel free to close if you don't think that would be useful :)