gaelj
October 10, 2026, 8:11am
1
Since today I’m getting 403 errors when running nix flake update on my flake input url = "gitlab:gaj-nixos/shared"; , which is a public repo.
nix flake update sharedConfig
warning: Git tree '/home/gaj/gaj-nixos-config' is dirty
warning: unable to download 'https://gitlab.com/api/v4/projects/gaj-nixos%2Fshared/repository/commits?ref_name=HEAD': HTTP error 403; using cached version
curl -sS "https://gitlab.com/api/v4/projects/gaj-nixos%2Fshared" shows that it’s now being blocked by Cloudflare.
EDIT:
`curl --show-headers “https://gitlab.com/api/v4/projects/gaj-nixos%2Fshared/repository/commits?ref_name=HEAD ”` shows that it’s now being blocked by Cloudflare.
I was able to work around the problem by replacing gitlab: with git+https://gitlab.com/ in the flake input URL.
4 Likes
NobbZ
October 10, 2026, 8:16am
2
I can not reproduce. I get a proper 200 from the API with sensible payload.
It might be that CF sees you as a malicious user of the internet because you are in the wrong IP-block, you tried to many requests, or whatever else.
It might work again later, it might be permanent (for the IP).
gaelj
October 10, 2026, 8:27am
3
Ah, thanks for the feedback. Now I realize I pasted the wrong curl command from my history, sorry
This is the one that fails for me:
curl --show-headers "https://gitlab.com/api/v4/projects/gaj-nixos%2Fshared/repository/commits?ref_name=HEAD"
HTTP/2 403
date: Sat, 10 Oct 2026 08:26:01 GMT
content-type: text/html; charset=UTF-8
content-length: 5638
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cf-mitigated: challenge
content-security-policy: default-src 'none'; script-src 'nonce-tTjwZaMsiZw1fpgtLsWegM' 'unsafe-eval' https://challenges.cloudflare.com; script-src-attr 'none'; style-src 'unsafe-inline'; img-src 'self' https://challenges.cloudflare.com; connect-src 'self' https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com blob:; child-src 'self' https://challenges.cloudflare.com blob:; worker-src blob:; form-action http: https:; base-uri 'self'
server: cloudflare
Would you be so kind as to confirm if this one is working on your side @NobbZ please ?
curl --show-headers "https://gitlab.com/api/v4/projects/gaj-nixos%2Fshared/repository/commits?ref_name=HEAD"
HTTP/2 403
date: Sat, 10 Oct 2026 08:45:49 GMT
content-type: text/html; charset=UTF-8
content-length: 5638
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cf-mitigated: challenge
content-security-policy: default-src 'none'; script-src 'nonce-n7youGv6NYgdNoV3RjYFFI' 'unsafe-eval' https://challenges.cloudflare.com; script-src-attr 'none'; style-src 'unsafe-inline'; img-src 'self' https://challenges.cloudflare.com; connect-src 'self' https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com blob:; child-src 'self' https://challenges.cloudflare.com blob:; worker-src blob:; form-action http: https:; base-uri 'self'
server: cloudflare
Do you have an API key configured for GitLab in nix.conf?
If you do maybe it’s expired and nix is attempting to use it for gitlab: but not the https url.
kiara
October 10, 2026, 6:53pm
6
hopefully this would fix it:
master ← KiaraGrouwstra:gitlab-single-commit-endpoint
opened 05:16PM - 10 Oct 26 UTC
Moves the GitLab fetcher from its [list endpoint] to its [single commit endpoint… ] `/repository/commits/<ref>`, aligning it with the GitHub fetcher.
## Motivation
This further seems to address CloudFlare's HTTP 403 errors on this endpoint, tho a workaround (until this lands) might be to switch `gitlab`-based flake inputs to [using `git+https`] instead.
This issue was also reported at:
- https://github.com/taiwenlee/Inventory_Kamera/issues/31
- https://github.com/y3owk1n/oku/pull/451
## Context
[list endpoint]: https://docs.gitlab.com/api/commits/#list-repository-commits
[single commit endpoint]: https://docs.gitlab.com/api/commits/#retrieve-a-commit
[using `git+https`]: https://discourse.nixos.org/t/gitlab-formatted-flake-inputs-now-blocked-by-cloudflare/80505/
---
Add :+1: to [pull requests you find important](https://github.com/NixOS/nix/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc).
The Nix maintainer team uses a [GitHub project board](https://github.com/orgs/NixOS/projects/19) to [schedule and track reviews](https://github.com/NixOS/nix/tree/master/maintainers#project-board-protocol).
Assisted-by: Claude:claude-opus-5-5
6 Likes
Can also repro this.
https://gitlab.com/api/v4/projects/rycee%2Fnur-expressions/repository/commits?ref_name=HEAD opens normally.
curl --show-headers https://gitlab.com/api/v4/projects/rycee%2Fnur-expressions/repository/commits?ref_name=HEAD
returns HTTP/2 403.
Switched from `gitlab:` to the genetic format for now
you can post this on twitter and tag Cloudflare Help (@CloudflareHelp) / X
gaelj
October 11, 2026, 10:35pm
9
Thanks to all for the replies so far. To answer @Lyndeno , no I don’t have any expired Gitlab API key.
So it seems like it’s a real problem, which could be fixed by @kiara ’s proposed change in nix.
I don’t use Twitter / X, but I don’t mind if anyone else cross-posts this thread on it.
I also reproduce this, so I switched to the workaround. No gitlab API key on my end. Definitely not too many requests. I’m not sure it’s the IP range either - I’m using a supposedly reputable ISP and the requests were not behind VPN.
i use a burner account on x