jcszymansk / nixcasks

Homebrew casks, nixified
MIT License
60 stars 3 forks source link

Brew Casks, nixified

This project is an effort to enable installing applications from Homebrew Casks repository as first class Nix packages, and therefore to make it possible to manage them with the usual Nix tools, especially Home Manager but also Nix-darwin and possibly others.

For most cases it should already work (but see limitations), I've been using it to manage most of the Homebrew Cask apps I use from the very first day I started this.

How to use:

with flakes:

    pkgs = import nixpkgs {
      inherit system;
      config.packageOverrides = _: {
        inherit nixcasks;
      };
    };

without flakes (not recommended):

Application variants

By default Nixcasks selects an application variant for your architecture (as determined from pkgs.system) and for the oldest yet supported macOS version, which is now monterey. If you want to use variants for a newer version of macOS, you need to declare it in the attribute osVersion in your import.

NOTE: as I don't have an ARM mac, ARM variations are now not tested at all; feel free to test and open an issue in case of problems.

What is supported

Most simple applications which have no installer are already supported; casks.json contains 2874 entries as I write it.

The applications' list is updated from Homebrew daily by a github action, so nixcasks has almost no delay behind the Homebrew.

Overrides: this allows specifying app-specific attributes which are not included in casks.json

Applications which require renaming (target attribute)

What is not yet supported

What will (probably) never be supported

Limitations

Home Manager and Nix-Darwin symlink the entries from Nix store into their respective Applications directories, the applications do not expect this and thus register their actual path (not the symlink) in the system registries, which will lead to confused effects, such as older instance being still available and associated with files open action despite an update. A possible workaround is here, also see this discussion.

Some DMG images (e.g. docker) use the new ULMO format and I am not aware of any way to unpack them in pure mode (required by sandbox). For now, and until the next 7zip release a workaround is used, an image which fails to test with 7zip is converted to an older format and then unpacked. The conversion requires hdiutil though, which breaks pure mode and therefore sandbox (see this issue).

LICENSE

This project is MIT-licensed. This is applicable to the Nix expressions, shell scripts and other software written for this project only. This license does not apply to any package which may be managed with the help of this project.

WARNING

There are many commercial packages in Homebrew Casks; neither this project nor Homebrew does distribute or sell them; it's your (the user's) responsibility to properly obtain any required license. Both Homebrew and this project only provide a way to automate their (un)installation.