feat(darwin): start MechvibesDX at login via a LaunchAgent - #185
Merged
Conversation
Replaces a System Settings login item with the declarative equivalent, next to the other resident agents. Launched through the bundle's executable rather than $out/bin: macOS derives the bundle from the executable's parent directories, and both the tray icon and the Accessibility entry depend on it being seen as a real .app. --minimized because the config's start_minimized only takes effect together with auto_start, which is the Windows registry path. No KeepAlive - quitting from the tray should stay quit, and a crash loop on an app this experimental would be worse than no sound.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なにを
MechvibesDX をログイン時に起動する。System Settings のログイン項目ではなく LaunchAgent で、mopidy / ollama と同じ宣言の場所に置く。
#184 に後から足したコミットだが、あちらはオートマージが先に発火して先の1コミットだけで入ってしまったので、取り残された分をここに切り出した。
判断
$out/binではなくバンドル内の実行ファイルを叩く。macOS は実行ファイルの親ディレクトリからバンドルを判定するので、トレイアイコンとアクセシビリティのエントリはどちらもそこに依存する--minimizedを渡す。config のstart_minimizedはauto_startと併用でしか効かず、それは Windows レジストリ側の経路なので、フラグで渡すのが確実KeepAliveなし。トレイから終了したら終了したままであるべきで、この完成度のアプリでクラッシュループする方が無音より悪いProcessType = "Interactive"。打鍵から音までのレイテンシがあるので、mopidy のエージェントと同じ扱いにするletで束縛し直した。home.packagesと ProgramArguments が同じ store path を指す必要があるため確認
nix eval .#homeConfigurations.gapul.activationPackage.drvPath通過。agent の ProgramArguments がビルド済みの store path のバンドル実行ファイルを指していることも確認済み。(#184 の本文には検証として
darwinConfigurations.gapul.system.drvPathを挙げていたが、このリポジトリでは home が別 output なのでそれは home 側を含んでいない。意味があるのは上記の方。)