When comparing Homebrew Cask vs Nix package manager, the Slant community recommends Homebrew Cask for most people. In the question“What are the best Mac package managers?” Homebrew Cask is ranked 2nd while Nix package manager is ranked 3rd. The most important reason people chose Homebrew Cask is:
Homebrew Cask allows you to install graphical applications through the command line, rather than having to go through the standard installation process. E.g. ```brew cask install google-chrome```
Ranked in these QuestionsQuestion Ranking
Pro Manage graphical applications through the command line
Homebrew Cask allows you to install graphical applications through the command line, rather than having to go through the standard installation process.
brew cask install google-chrome
Pro Extends Homebrew
Homebrew Cask adds functionality to Homebrew such as allowing downloads of commercial licensed apps.
Pro You always and atomically get an isolated consistent profile
Every time you install, delete or change anything you get a new fresh copy of your user environment (set of symlinks to files in /nix/store) that's stored in the same /nix/store and handled mostly the same way. Your "profile" (symlink to one of environments) is updated after everything else is ready, so you'll never end up in a half-finished state of your system.
Pro Can keep around several profiles for you to use
You can have different (probably overlapping) sets of software installed in two or more profiles that will be handled (changed, versioned, upgraded, reverted) independently. All software will be installed in the same /nix/store, so any overlaps between your sets will be physically installed only once.
Pro It's easy to revert any change in your environment
Every time your profile changes, you get a new generation of your profile and older generations are kept around, so you can easily (and atomically) revert to older version of your profile.
Pro Packages don't change after they are built
Nix treats packages like values in a functional language. Since they are built by functions without side effects they never change after they are built.
Pro Packages installed with Nix don't overlap with packages installed in /usr/local
Since packages are stored in the /nix directory, it won't overlap with anything you'd install in /usr/local or wherever else.
Pro Does not require root priviledges
Everything is owned by your user (unless you use more powerful multiuser mode that doesn't require root either).
Pro Uses binary caches (that are provided) so you don't have to build anything locally
Due to its functional nature, it can just download a binary package with the same hash if its available and it'll get the very same package as you'd build locally (to the last bit that is).
Pro Easy to install
Requires just one shell script to install, only one directory is created via sudo. This makes for a pretty simple install method that most can grasp.
Pro Very easy to share compiled binaries between machines
You can share packages via HTTP or SSH (push or pull) with just some simple commands.
Con Duplicate apps found in brew may cause issue
There are warnings provided that apps found in brew should not be installed with brew cask (and vice versa). While the user is warned of this, mistakes can happen, which would be better to just see them avoided all together by not supplying duplicate apps.
Con Requires Xcode
Homebrew Cask requires that Xcode is installed, which may be more work than what some want to spend on configuring this app.
Con Cannot handle filetypes that have different semantics across different versions
While the functional approach that Nix takes is great for sandboxing binary artifacts of packages, it seriously lacks any power in handling configuration files or user data. It's difficult to upgrade and downgrade files where semantics and syntax can change between versions. Especially in Debian/Ubuntu it can cause severe problems where the upgrade process blocks and the user needs to resolve the 3-way merge.