NixCasks is a tool that transforms Homebrew casks (GUI applications) recipes into Nix derivations, enabling users to install Homebrew casks directly without brew being installed.
Visit NixCasks website for more info and list of packages
NixCasks is a flake that exports compatible Homebrew cask through packages.<system>.<package>. NixCasks can be added to your flake via GitHub.
nix-casks = {
url = "github:atahanyorganci/nix-casks/archive";
inputs.nixpkgs.follows = "nixpkgs";
};Installing packages is just adding it to environment.systemPackages for global and users.user.<name>.packages for per user on nix-darwin and home.packages via HomeManager.
home.packages = with inputs.nix-casks.packages.${pkgs.system}; [
raycast
slack
visual-studio-code
whatsapp
brave-browser
vlc
];NixCasks parses the cask files mostly from https://formuale.brew.sh/api/cask.json and converts into JSON file that can be used in Nix derivation. JSON file contains basic package info (name, version, description, etc.), package source (mostly .dmg and .zip files) and install steps.
NixCasks provides unpack.sh that can extract applications from .dmg via hdiutil and other archive formats. Install steps are determined according to Cask Cookbook, for example moving /Name.app to $out/Applications/Name.app. Lastly, the package is linked from Nix store to the system, symlinked applications become discoverable by other applications (i.e. Spotlight, Raycast, etc.) as NixCasks respects the MacOS directory structure.
Note
NixCasks currently supports zip archives (.zip files) and disk images (.dmg files) in unpackPhase. Please contribute by creating an issue or PR with package name and source file format.
Official NixCasks website provides full list of available packages and hosts API to update the package repository. OpenAPI spec is available at /api/openapi and Scalar API reference is available at /api/reference.
The website is server rendered Astro app hosted on Vercel. The tech stack is as follows.
- Astro for server-side rendering of mostly static pages
- Drizzle for schema management and querying
- TailwindCSS for sane CSS
- PlanetScale Postgres for best in class Postgres
- Upstash Qstash for securely invoking update workflow on CRON schedule
- Tigris for storing package bundles and hosting archives
- Vercel for hosting
- Cloudflare for DNS and DDoS protection
- GitHub Actions for updating
archive.jsonafter scheduled package update
.pkgfiles are unsupported, as it requiressudoprivileges to be executed.- Other archive formats may not be supported.
- Atahan Yorgancı, @atahanyorganci