{"id":21659244,"url":"https://github.com/BatteredBunny/brew-nix","last_synced_at":"2025-07-17T22:31:35.588Z","repository":{"id":238132246,"uuid":"795898620","full_name":"BatteredBunny/brew-nix","owner":"BatteredBunny","description":"Experimental nix expression to package all MacOS casks from homebrew automatically","archived":false,"fork":false,"pushed_at":"2025-04-27T21:30:24.000Z","size":31,"stargazers_count":244,"open_issues_count":4,"forks_count":13,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-24T02:06:40.009Z","etag":null,"topics":["brew","flake","homebrew","nix","nix-darwin","nix-flake"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BatteredBunny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-04T11:07:43.000Z","updated_at":"2025-05-23T15:46:37.000Z","dependencies_parsed_at":"2024-05-04T14:39:39.309Z","dependency_job_id":"7830be10-f1e4-4a82-9f7c-524e5bdf18be","html_url":"https://github.com/BatteredBunny/brew-nix","commit_stats":null,"previous_names":["batteredbunny/brew.nix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BatteredBunny/brew-nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatteredBunny%2Fbrew-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatteredBunny%2Fbrew-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatteredBunny%2Fbrew-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatteredBunny%2Fbrew-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BatteredBunny","download_url":"https://codeload.github.com/BatteredBunny/brew-nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatteredBunny%2Fbrew-nix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265672333,"owners_count":23808842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brew","flake","homebrew","nix","nix-darwin","nix-flake"],"created_at":"2024-11-25T09:30:43.602Z","updated_at":"2025-07-17T22:31:35.583Z","avatar_url":"https://github.com/BatteredBunny.png","language":"Nix","funding_links":[],"categories":["nix","Nix"],"sub_categories":[],"readme":"# brew-nix\n\nAn experimental nix expression as a nixpkgs overlay to package all macOS [Homebrew Casks](https://brew.sh/) automatically.\n\n## Benefits over nix-darwin's homebrew module\n\n1. No homebrew installation needed; packages are fully managed by nix.\n2. Pure nix, package derivations; everything is type checked and it will give you an error when you specify an invalid package for example.\n\n## Limitations/Flaws\n\n1. Running most programs with `nix run` won't work, you'll have to build them first.\n2. Some programs refuse to run from non-standard locations, since this is automatic there isn't a good way to fix it.\n3. There're about 700 casks without hashes, so you have to [override the derivation attributes \u0026 provide a hash explicitly](#overriding-casks-derivation-attributes-for-casks-with-no-hash).\n4. Having several generations with this will take A LOT of disk space, so keep that in mind.\n\n## Related projects\n\n- [mac-app-util](https://github.com/hraban/mac-app-util)\n- [nixcasks](https://github.com/jcszymansk/nixcasks)\n\n# Usage examples\n\n## Basic usage\n\n```bash\nnix build github:BatteredBunny/brew-nix#blender\n./result/Applications/Blender.app/Contents/MacOS/Blender\n```\n\nor declaratively\n\n```nix\nhome.packages = [ pkgs.brewCasks.visual-studio-code ];\n```\n\n## Overriding cask's derivation attributes for casks with no hash\n\nMany casks do not come with their hash so you'll have to provide one explicitly.\n\n```nix\nhome.packages = with pkgs; [\n  (brewCasks.marta.overrideAttrs (oldAttrs: {\n    src = pkgs.fetchurl {\n      url = builtins.head oldAttrs.src.urls;\n      hash = lib.fakeHash; # Replace with actual hash after building once\n    };\n  }))\n];\n```\n\n## Overriding cask's variation\n\nExplicitly choose homebrew cask variations (Quite a few casks have variations for different architectures or macOS versions).\nYou can look up each cask's respective variations at [brew.sh](https://brew.sh/).\n\n```nix\nhome.packages = lib.attrsets.attrValues {\n  vscode = (pkgs.brewCasks.visual-studio-code.override {variation = \"sequoia\";});\n};\n```\n\n## Overriding both cask's variation \u0026 derivation attributes\n\n```nix\nhome.packages = lib.attrsets.attrValues {\n  vscode = (pkgs.brewCasks.visual-studio-code.override {variation = \"sequoia\";}).overrideAttrs (oldAttrs: {\n    src = pkgs.fetchurl {\n      url = lib.lists.head oldAttrs.src.urls;\n      hash = lib.fakeHash; # Replace with actual hash after building once\n    };\n  });\n};\n```\n\n# Setup\n\n## Setup with nix-darwin\n\nSee [`examples/flake.nix`](examples/flake.nix).\n\n## Setup with home-manager\n\n```nix\n# flake.nix\ninputs = {\n  brew-nix = {\n    url = \"github:BatteredBunny/brew-nix\";\n    inputs.brew-api.follows = \"brew-api\";\n  };\n  brew-api = {\n    url = \"github:BatteredBunny/brew-api\";\n    flake = false;\n  };\n};\n```\n\n```nix\n# home.nix\nnixpkgs = {\n  overlays = [\n    inputs.brew-nix.overlays.default\n  ];\n};\n\nhome.packages = with pkgs; [\n  brewCasks.marta\n  brewCasks.\"firefox@developer-edition\" # Casks with special characters in their name need to be defined in quotes\n];\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBatteredBunny%2Fbrew-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBatteredBunny%2Fbrew-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBatteredBunny%2Fbrew-nix/lists"}