{"id":30143128,"url":"https://github.com/juspay/chutney","last_synced_at":"2025-08-11T06:49:55.583Z","repository":{"id":308834471,"uuid":"947368762","full_name":"juspay/chutney","owner":"juspay","description":"WIP: Reliable Nix Cache Server configuration for self-hosting","archived":false,"fork":false,"pushed_at":"2025-08-08T07:26:26.000Z","size":98,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-08-08T07:29:41.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juspay.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":"2025-03-12T15:23:02.000Z","updated_at":"2025-08-08T07:26:28.000Z","dependencies_parsed_at":"2025-08-08T07:29:43.737Z","dependency_job_id":"7ea785e8-6cda-40db-aa20-3a85aefb89b8","html_url":"https://github.com/juspay/chutney","commit_stats":null,"previous_names":["juspay/chutney"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/juspay/chutney","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fchutney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fchutney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fchutney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fchutney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juspay","download_url":"https://codeload.github.com/juspay/chutney/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fchutney/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269843691,"owners_count":24484115,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-11T06:49:52.256Z","updated_at":"2025-08-11T06:49:55.558Z","avatar_url":"https://github.com/juspay.png","language":"Nix","funding_links":[],"categories":["Nix"],"sub_categories":[],"readme":"# chutney\n\n\u003e [!NOTE]\n\u003e **Status: 🚧 Work in Progress 🚧**\n\u003e\n\u003e This project might undergo changes as we scale the cache to cover over 1000 users at Juspay.\n\u003e\n\u003e Track https://github.com/juspay/chutney/issues/17 for reliability issues.\n\n`chutney` provides a NixOS + [terranix](https://terranix.org/) configuration to deploy a reliable Nix binary cache server, powered by [attic](https://docs.attic.rs/).\n\n- [Getting Started](#getting-started)\n- [Guide](#guide)\n  - [Cache Creation](#create-cache)\n  - [Secrets](#secrets)\n  - [Garbage Collection](#garbage-collection)\n  - [Migration](/docs/MIGRATION.md)\n- [Gotchas](#gotchas)\n- [Discussion](#discussion)\n\n## Getting Started\n\nBy default, chutney deploys its infrastructure on AWS. To get started, follow the [AWS guide](/docs/AWS.md).\n\nIf you are not using AWS, you can use the standalone NixOS modules, which are decoupled from the terranix configuration. See the [NixOS Modules guide](/docs/NIXOS_MODULES.md).\n\n## Guide\n\n### Administrate cache\n\nLogin to attic using the root-token for admin related work:\n```\ncd secrets \u0026\u0026 nix run nixpkgs#attic-client -- login root https://cache.nixos.asia $(agenix -d attic/root-token.age)\n```\n\n### Create cache\n\n- Ensure you are logged in as an admin (see [Administrate cache](#administrate-cache))\n- Run `nix run nixpkgs#attic-client cache create \u003ccache-name\u003e`\n- SSH into the host and generate the access token, see comments above `attic/oss-push-token.age` in `secrets/secrets.nix`. Also see \u003chttps://docs.attic.rs/tutorial.html#access-control\u003e\n\n### Secrets\n\n`chutney` uses [agenix](https://github.com/ryantm/agenix) for secrets management.\n\n#### Adding a new secret\n\nRun `cd secrets \u0026\u0026 agenix -e \u003cmysecret.age\u003e`\n\n#### Editing an existing secret\n\nRun `just secret-edit` and select the key to edit.\n\n#### Adding a new user/host\n\nAdd the new user/host in `./secrets/secrets.nix` and run `just secrets-rekey` to allow the new user/host to decrypt the keys.\n\n### Garbage Collection\n\n\u003e [!NOTE]\n\u003e Auto GC is disabled in `chutney`. The only way GC will free up space is if you have configured `retention-period` for your cache. See \u003chttps://docs.attic.rs/tutorial.html#garbage-collection\u003e\n\nRun Garbage Collection once:\n```sh\nssh root@\u003cpublic-ip\u003e\nsudo -u atticd attic-gc-once\n```\n\n### Support more platforms in `.terraform.lock.hcl`\n\nCurrently only `darwin_arm64` is supported. To manage infra from other platform/s, follow:\n- `mv .terraform.lock.hcl .terraform.lock.hcl.bkp`\n- `terraform init`\n- Add back the extra `hashes` from `.terraform.lock.hcl.bkp` to `.terraform.lock.hcl`\n\nWe can't use the `terraform providers lock -platform=\u003cplatform-1\u003e -platform=\u003cplatform-2\u003e ...` as this command always fetches and locks the latest aws provider and not the pinned one from nixpkgs (The provider is pinned using `terraform.withPlugins` in `devShells.default` ).\n\n## Gotchas\n\n### Flaky `destroy`\n\n`destroy` script can indefinitely keep trying to delete the `aws_vpc.chutney`, this happens (atleast with Juspay's AWS account) when the vpc has a non-default security group depenedency not managed by terraform. This dependency has to be manually deleted by running `nix run .#vpc-sg-cleanup \u003cvpc-id\u003e` in another terminal window.\n\n### HTTP 524\n\nIf your domain uses cloudflare and the requests are proxied through cloudflare, `attic push` might fail on large Nix store objects with`HTTP 524`. This is owing to [cloudflare's 100 second timeout](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/#error-524-a-timeout-occurred). You can fix this by changing `Proxy status` for your domain from `Proxied` to `DNS only` in the cloudflare dashboard, as the aforementioned page describes:\n\n\u003e If you regularly run HTTP requests that take over 100 seconds to complete (for example, large data exports), move those processes behind a subdomain not proxied (grey clouded) in the Cloudflare DNS app.\n\n## Discussion\n\nTo discuss this project, post in [GitHub Discussions](https://github.com/juspay/chutney/discussions) or join the [NixOS Asia community](https://nixos.asia/en/#community).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuspay%2Fchutney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuspay%2Fchutney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuspay%2Fchutney/lists"}