Skip to content

Commit 5962af3

Browse files
williamdemeoclaude
andcommitted
flake: fetch inputs via git+https instead of github: shorthand
The `github:` flake-ref shorthand fetches source as tarballs from api.github.com / codeload.github.com. In the Claude Code web sandbox these endpoints are served by a GitHub proxy that scopes access to the session's own repositories and returns HTTP 403 for every other repo, so `nix develop` fails while resolving third-party inputs (flake-parts, nixpkgs, agda.nix and its transitive Agda libraries). Plain git-over-https, by contrast, is served by that proxy for any public repo. Declaring the inputs as `git+https://github.com/...` and pinning the lock nodes to the `git` fetcher routes resolution through the working path. The narHash for each rev is identical between the two fetchers, so the pins are unchanged and this is a no-op on unrestricted networks. nixpkgs additionally sets `shallow=1`: when the pinned source cannot be substituted by narHash from a binary cache, a shallow fetch of the locked rev avoids cloning nixpkgs' full history. Verified with `nix develop --command agda --version` (Agda 2.8.0). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1ArmS9aNbCxuwhC7zYLBx
1 parent 193d640 commit 5962af3

2 files changed

Lines changed: 51 additions & 63 deletions

File tree

flake.lock

Lines changed: 42 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
{
33
description = "Formal Ledger Specifications";
44

5+
# NOTE: inputs use git+https://... instead of the github: shorthand. The
6+
# github: fetcher pulls tarballs from api.github.com / codeload.github.com,
7+
# which the Claude Code web sandbox proxy 403s for third-party repos; plain
8+
# git-over-https works there for any public repo. narHashes are identical
9+
# between the two fetchers, so the pins are unchanged. nixpkgs adds
10+
# `shallow=1` so a binary-cache miss fetches only the locked rev.
511
inputs = {
6-
nixpkgs.url = "github:NixOs/nixpkgs";
12+
nixpkgs.url = "git+https://github.com/NixOs/nixpkgs?shallow=1";
713

814
flake-parts = {
9-
url = "github:hercules-ci/flake-parts";
15+
url = "git+https://github.com/hercules-ci/flake-parts";
1016
};
1117

1218
agda-nix = {
13-
url = "github:input-output-hk/agda.nix";
19+
url = "git+https://github.com/input-output-hk/agda.nix";
1420
inputs.nixpkgs.follows = "nixpkgs";
1521
};
1622
};

0 commit comments

Comments
 (0)