{"id":18465535,"url":"https://github.com/numtide/nixos-passthru-cache","last_synced_at":"2025-10-29T01:43:35.911Z","repository":{"id":269872847,"uuid":"881821535","full_name":"numtide/nixos-passthru-cache","owner":"numtide","description":"Create a copy of https://cache.nixos.org for your infrastructure","archived":false,"fork":false,"pushed_at":"2024-12-27T11:16:40.000Z","size":12,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T13:34:53.886Z","etag":null,"topics":["buildbot-numtide"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numtide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-11-01T10:03:41.000Z","updated_at":"2025-02-12T12:04:23.000Z","dependencies_parsed_at":"2024-12-26T20:19:17.146Z","dependency_job_id":"138f378b-9607-4aec-ad6a-1e27461479c1","html_url":"https://github.com/numtide/nixos-passthru-cache","commit_stats":null,"previous_names":["numtide/nixos-passthru-cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fnixos-passthru-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fnixos-passthru-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fnixos-passthru-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fnixos-passthru-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtide","download_url":"https://codeload.github.com/numtide/nixos-passthru-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239166511,"owners_count":19593039,"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":["buildbot-numtide"],"created_at":"2024-11-06T09:13:25.305Z","updated_at":"2025-10-29T01:43:35.906Z","avatar_url":"https://github.com/numtide.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nixos-passthru-cache\n\nStop paying to download the same bytes twice.\n\nStatus: Beta - solid core; interfaces may still change.\n\nMaintained by Numtide.\n\n## What It Is\n\nA drop‑in, pull‑through cache for Nix. Put it on your network, point your machines at it, and watch egress fall while builds get faster.\n\n## Who It’s For\n\nInfra and platform teams running many Nix machines - enterprises, universities, events. Anywhere repeating downloads hurt cost and speed.\n\n## Why It Matters\n\ncache.nixos.org serves billions of requests and petabytes of data every month. Caching locally keeps those bytes close - and your bill lower.\n\n## Quick Start (Server on NixOS)\n\nIn your `flake.nix`:\n\n```\ninputs = {\n  nixos-passthru-cache = {\n    url = \"github:numtide/nixos-passthru-cache\";\n    inputs.blueprint.follows = \"blueprint\";\n    inputs.nixpkgs.follows = \"nixpkgs\";\n  };\n};\n```\n\nIn your NixOS configuration:\n\n```\n{\n  imports = [ inputs.nixos-passthru-cache.nixosModules.nixos-passthru-cache ];\n\n  services.nixos-passthru-cache.enable = true;\n  services.nixos-passthru-cache.hostName = \"cache.example.org\";\n  # Optional: change upstream (defaults to https://cache.nixos.org)\n  # services.nixos-passthru-cache.upstream = \"https://my-upstream-cache.example\";\n  # Optional: adjust cache size (default 200G)\n  # services.nixos-passthru-cache.cacheSize = \"500G\";\n}\n```\n\n## Point Clients At It\n\nNixOS:\n\n```nix\n{\n  nix.settings.extra-substituters = [ \"https://cache.example.org\" ];\n}\n```\n\n`nix.conf`:\n\n```\nextra-substituters = https://cache.example.org\n```\n\n## Validate\n\n```\ncurl -I https://cache.example.org/nix-cache-info\n```\n\nLook for HTTP 200. You’ll also see `X-Cache-Status` headers on proxied requests.\n\n## Zero‑Config LAN Mode (Bonjour/mDNS)\n\nFor trusted LANs: discoverable, no‑TLS, mDNS hostname (`hostname.local`).\n\n```nix\n{\n  services.nixos-passthru-cache.enable = true;\n  services.nixos-passthru-cache.lanMode = true;\n  # hostName defaults to networking.hostName + \".local\"\n  # TLS (forceSSL) defaults to false\n}\n```\n\nThis publishes an `_http._tcp` Bonjour service on port 80 via Avahi and opens mDNS in the firewall.\n\n## Traffic Stats (NGINX VTS)\n\nSee traffic, hit/miss, and cache health.\n\n- Path: `/status`\n- Defaults: enabled in LAN mode; otherwise off and localhost‑only\n\nEnable explicitly when not in LAN mode:\n\n```nix\n{\n  services.nixos-passthru-cache.enable = true;\n  services.nixos-passthru-cache.stats.enable = true;\n  # Optional: open beyond localhost\n  # services.nixos-passthru-cache.stats.allowLocalOnly = false;\n}\n```\n\nVisit `https://cache.example.org/status` (or `http://` in LAN mode).\n\n## Demo Cache (Best‑Effort)\n\n- Hetzner (Frankfurt): https://hetzner-cache.numtide.com — useful if you run in Hetzner networks\n- Uplink: 1G • Hardware: AX52\n\nUse it from NixOS:\n\n```nix\n{\n  nix.settings.extra-substituters = [ \"https://hetzner-cache.numtide.com\" ];\n}\n```\n\nOr from `nix.conf`:\n\n```\nextra-substituters = https://hetzner-cache.numtide.com\n```\n\n## Operate\n\n- Default cache size: 200G (tunable)\n- Ports: 80/443 (TLS on by default unless LAN mode)\n- Health: `curl -I /nix-cache-info` and check `/status` if enabled\n\n## Support\n\nMaintained by Numtide. Issues and contributions welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fnixos-passthru-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtide%2Fnixos-passthru-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fnixos-passthru-cache/lists"}