6 ms·
Brew-Nix: a flake automatically packaging all homebrew casks
- loveparade 2y agoThis looks interesting. Personally I have been moving away from homebrew and use nix-darwin (https://github.com/LnL7/nix-darwin https://github.com/LnL7/nix-darwin) with home-manager for my local software. It has been working great, but there are still a few packages that require Homebrew due to their complex build process. Maybe this helps.
- conradev 2y agoSame. The story with app bundles in Nix is a little rough, currently, though: - Located in the nix store, so not indexed by Spotlight - Not signed so I have to grant permissions all over again when an app gets rebuilt
- mbrumlow 2y agoI have a post hook that renders a Automator app to Applications to call the next one for me. Seems to work well for the few apps I use like that.
- loveparade 2y agoInstead of Spotlight I use Raycast. It has been working great for me.
- tymscar 2y agoI also do that, but when I search for emacs for example I get like 2-3 different ones and they are named as the full path in the nix store. That sometimes goes away after some time with indexing, but sometimes it does not. And another annoying issue is that sometimes even when theres only one, its called by the path, and Im not a wizard so I don’t know if that path is the latest, so I am still using outdated software because its not launching the newest version. Did you have any of these issues?
- nothrabannosir 2y agoI actually wrote a script which creates a trampoline launcher for this. It has its flaws but it solves the spotlight issue, and supports pinning to Dock across updates. Available as a plug-and-play module for nix-darwin and home-manager: https://github.com/hraban/mac-app-util https://github.com/hraban/mac-app-util
- sunaookami 2y agoThis is great! I run a script with mkalias[1] which works fine but all icons have this ugly arrow. Yours works perfectly - only thing missing is the icon in the spotlight search. EDIT: Hm seems to not affect every app. [1] https://github.com/reckenrode/mkalias https://github.com/reckenrode/mkalias
- deleted 2y ago[deleted]
- parhamn 2y agoMind sharing some reasons to switch? Been meaning to check out nix.
- colordrops 2y agoPackage installation and personal config in a single declarative language, reproducible with a single command, and shareable across platforms. But that's just scratching the surface of Nix's capabilities.
- loveparade 2y agoHere are a couple: - Learn Nix - Homebrew can be a pain. I've had several occasions where it broke something on my system with its magic. The main reason for this is its imperative (as opposed to declarative) nature. You can easily install things that clash with other software installed on your system. - You can easily install different versions of the same software without having to worry about clashes - Fully declarative configuration. You know exactly what is installed on your system at any time. - Portable reproducible configuration. Imagine you get a new laptop. Because you have have your system configuration declared with nix and home-manager you can copy the configuration file, run install, and your system is set up, exactly the way the old one was. - To add to the above, you can also do the same with non-MacOS systems if you make your config conditional on MacOS. I sometimes want to work on a remote Linux machine. I can set up a full dev environment with all the tools I use locally with a single command now.
- mikemcquaid 2y agoIf you want a more declarative approach to Homebrew: ‘brew bundle’ uses ‘Brewfile’s for this. You can share these on macOS and Linux and add similar conditionals. Not nearly as reproducible but: this is something I’m working on. Stay tuned…
- pxc 2y agoThe existing Brewfile functionality what Nix-Darwin's Homebrew module currently uses behind the scenes, so any improvements here might also benefit some Nix users on macOS (including me!). The conditionals and cross-platform stuff might also make it possible to write a single module here that enables use of Homebrew as an escape hatch both on macOS and Linux/NixOS, which would maybe be kinda cool. So thank you for that work. :)
- srid 2y agoYou don't even need nix-darwin per se. You can get by just with home-manager and do a lot with it. Here's a template config to get started: https://github.com/juspay/nix-dev-home https://github.com/juspay/nix-dev-home --- That said, nix-darwin is still useful for doing system level things, like enabling Touch ID for `sudo`. I use that in my config: https://github.com/srid/nixos-config https://github.com/srid/nixos-config
- madmax96 2y agoI love nix on macOS. But one word of caution: nix uses a very outdated, EOL’d, macOS SDK (https://github.com/NixOS/nixpkgs/issues/101229 https://github.com/NixOS/nixpkgs/issues/101229).
- viraptor 2y agoIn practice, it's not that restricting. It's pretty rare to find something actually requiring a more recent version. (And there's slow progress in updating it)
- pxc 2y agoRandy Eckenrode is doing work pushing this forward almost every day, and constantly posting little updates on Matrix in the Nix on macOS channel. If anyone reading this is invested in that work, you can track it just by idling in the room. I'm sure he'd appreciate help or even just sincere expressions of encouragement or gratitude.
- viraptor 2y agoYou can also sponsor the work https://opencollective.com/nix-macos https://opencollective.com/nix-macos
- madmax96 2y agoGranted, it’s not restrictive if you only want to use Nix for general utilities and Unix libraries. But it’s extremely restricting if you want to use Nix to manage macOS apps. And I love Nix, so of course I want to do that :) Thanks for posting the link to sponsor this work.
- aliasxneo 2y agoI always have brew available because I inevitably run into issues with Nix packages (primarily managed by home-manager) on a pretty regular basis. Feels like I would be going in the opposite direction by wrapping them in Nix.
- pxc 2y agoWhat kinds of issues do you run into most often? What have you run into recently?
- aliasxneo 2y agoIt seems to show up mostly in Python-based applications. Recently, I tried adding pyinfra to my system, but it failed to run because of some weird missing dependencies that I could never figure out. The other big issues are languages. Most compilers and what not will build artifacts linked to the Nix store, which can result in surprising side effects. I tried switching to pyenv using Nix but then I had strange side-effects when trying to use it with poetry. So now I just install all of my language tools using homebrew and have had zero issues since.
- ThrowawayTestr 2y agoI love how this title is incomprehensible to 99% of people
- muixoozie 2y agoYea, I have no idea what a homebrew cask is. (Joking.. I am the 1%)
- deleted 2y ago[deleted]
- okkdev 2y agoThis is cool, but I still need some packages that only work through brew. What I've done is to just let nix generate a Brewbundle file and run the bundle install when it changes. https://github.com/okkdev/dotnix/blob/main/home%2Fhomebrew.nix https://github.com/okkdev/dotnix/blob/main/home%2Fhomebrew.n...
- KolenCh 2y agoReading the comments, may be it is worth clarifying: this allows macOS users with nix package manager to install brew cask (I.e. typically GUI program that companies releases as pkg or dmg, etc., such as Mathematica, GitHub Desktop, Adobe CC…) without having brew at all. I.e. it “steals” those brew cask formula and automatically repackage them as nix packages. A closely related usage would be macOS with nix with nix-darwin, and using nix-darwin config to includes brew casks. This way, nix-darwin assumes brew exists and uses brew to install those casks. This does have a major distinction on where the applications actually located, where some applications would upset if it is not inside /Applications.