{"id":43495368,"url":"https://github.com/tweag/buck2.nix","last_synced_at":"2026-02-03T10:35:49.470Z","repository":{"id":294204851,"uuid":"936628965","full_name":"tweag/buck2.nix","owner":"tweag","description":"Buck2 rules for Nix","archived":false,"fork":false,"pushed_at":"2025-05-19T10:08:00.000Z","size":25,"stargazers_count":10,"open_issues_count":2,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-19T11:27:00.868Z","etag":null,"topics":["buck2","nix"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tweag.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-21T12:13:11.000Z","updated_at":"2025-05-09T08:32:10.000Z","dependencies_parsed_at":"2025-05-19T11:37:12.325Z","dependency_job_id":null,"html_url":"https://github.com/tweag/buck2.nix","commit_stats":null,"previous_names":["tweag/buck2.nix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tweag/buck2.nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fbuck2.nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fbuck2.nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fbuck2.nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fbuck2.nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tweag","download_url":"https://codeload.github.com/tweag/buck2.nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fbuck2.nix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29041671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["buck2","nix"],"created_at":"2026-02-03T10:35:48.479Z","updated_at":"2026-02-03T10:35:49.461Z","avatar_url":"https://github.com/tweag.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# buck2.nix\n\nIntegrate [Nix](https://nixos.org/) with [Buck2](https://buck2.build/) to configure toolchains and dependencies for a project.\n\n# Motivation\n\nBuck2 is a polyglot build system that is designed to be fast and efficient for large codebases. Buck2 relies on remote execution for build isolation to enforce hermetic builds, therefore does not isolate local build actions so strictly.\n\nNix is a powerful package manager and build system for Linux and other Unix-like operating systems which strives for reproducibility. The [`nixpkgs`](https://search.nixos.org/packages)\nrepository is a very comprehensive, large collection of software packaged using nix.\n\nBy integrating Nix with Buck2 and leveraging the `nixpkgs` package collection, a project can define its required build tools and toolchains (e.g. C++, Python, Rust) declaratively and reproducibly but still benefit from fast, reliable builds.\n\n# Quickstart\n\nTo create a project using **buck2.nix**, run:\n\n```console\n$ nix flake new --template github:tweag/buck2.nix quickstart\n```\n\nTo build the project, run:\n\n```console\n$ cd quickstart\n$ nix develop\n$ buck2 build ...\n```\n\n_Note:_ if you use [direnv](https://github.com/direnv/direnv), just run `direnv allow` in the project directory.\n\n# Usage\n\n1. add it to you `.buckconfig` setting the commit hash to the current main branch:\n\n```ini\n[external_cells]\nnix = git\n\n[external_cell_nix]\ngit_origin = https://github.com/tweag/buck2.nix.git\ncommit_hash = ...\n```\n\n2. add a nix flake to your project\n\ne.g. in `tools/nix/flake.nix`:\n\n``` nix\noutputs = { ... }: {\n  packages.${system}.python = python3;\n}\n```\n\n3. use it in your project\n\nin `tools/BUCK`:\n\n```bazel\nload(\"@nix//flake.bzl\", \"flake\")\n\nflake.package(\n    name = \"python\"\n    binary = \"python\",\n    path = \"nix\",\n)\n```\n\nSee the [documentation](docs#flakepackage) and examples in [`examples/`](examples/).\n\n\n# Links\n\n* https://github.com/thoughtpolice/buck2-nix -- alternative prelude using nix\n\n# Sponsors\n\nbuck2.nix was funded by [Mercury Technologies](https://mercury.com/) and is maintained by [Tweag](https://tweag.io/)\n\n# License\n\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweag%2Fbuck2.nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftweag%2Fbuck2.nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweag%2Fbuck2.nix/lists"}