LnL7 / nix-darwin

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

Option to add `vscode` entries in Brewfile #1027

Open ian-h-chamberlain opened 3 months ago

ian-h-chamberlain commented 3 months ago

As described in the homebrew-bundle README, vscode is a supported option in Brewfiles.

This seems like it would be a convenient addition to the homebrew module - it's already possible to achieve something similar with homebrew.extraConfig but it seems reasonable enough to add this for parity with casks, whalebrew etc.

One question that comes to mind is whether any automatic installation of VSCode should be enabled by such an option, like how whalebrew does:

When this option is used, "whalebrew" is automatically added to homebrew.brews.

Some people might be using programs.vscode or other methods to install VSCode, but in that case they're probably declaring extensions that way, so maybe it would make sense to install the visual-studio-code cask (although some people may want visual-studio-code@insiders instead). I'd probably lean towards just documenting that VSCode must be installed somehow, since activation would probably just fail anyway if it wasn't: https://github.com/Homebrew/homebrew-bundle/blob/e97d33cc31c64fdd0c7412c182668783a2d706d6/lib/bundle/vscode_extension_installer.rb#L22

Would a PR to add this functionality be accepted? I have a working implementation already so I'm happy to upstream if so.