fix: add host attr of github/gitlab flakerefs to URL serialization#2789
Merged
mkenigs merged 1 commit intorelease-1.3.16from Feb 28, 2025
Merged
fix: add host attr of github/gitlab flakerefs to URL serialization#2789mkenigs merged 1 commit intorelease-1.3.16from
mkenigs merged 1 commit intorelease-1.3.16from
Conversation
Backport of upstream PR targeting nix >= 2.27 <NixOS/nix#12580> When installing `github` or `gitlab` flake refs with an alternative host to an environment, the environment will fail to build in the general case where the store paths are not substitutable: ``` flox install gitlab:foo/bar?host=gitlab.example.com ❌ ERROR: Failed to build environment: Failed to realise 'bar': error: … while fetching the input 'gitlab:foo/bar/87687do78you0876ear1eallya2eacd62read77cadthis' error: unable to download 'https://gitlab.com/api/v4/projects/foo%2bar/repository/archive.tar.gz?sha= 87687do78you0876ear1eallya2eacd62read77cadthis': HTTP error 404 response body: {"message":"404 Project Not Found"} ``` That is because nix drops the `host` parameter when serializing the locked flakeref to a url. The included patch adds the `?host` query back to the locked url.
mkenigs
approved these changes
Feb 28, 2025
ysndr
added a commit
that referenced
this pull request
Jul 18, 2025
Originally introduced in <#2789> the patch was merged upstream into master in February via <NixOS/nix#12580>. Assuming it was available via Nix in nixpkgs in late June, we removed the patch in <#3176>, which bumped our nix distribution to v2.28.2. It turns out that the upstream patch was only released via nix **2.29.0**, thus by removing our patch we regressed that behavior. This commit reintroduces the patch, while we use nix 2.28.3.
tomberek
pushed a commit
that referenced
this pull request
Jul 18, 2025
Originally introduced in <#2789> the patch was merged upstream into master in February via <NixOS/nix#12580>. Assuming it was available via Nix in nixpkgs in late June, we removed the patch in <#3176>, which bumped our nix distribution to v2.28.2. It turns out that the upstream patch was only released via nix **2.29.0**, thus by removing our patch we regressed that behavior. This commit reintroduces the patch, while we use nix 2.28.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of upstream PR targeting nix >= 2.27
NixOS/nix#12580
When installing
githuborgitlabflake refs with an alternative host to an environment, the environment will fail to build in the general case where the store paths are not substitutable:That is because nix drops the
hostparameter when serializing the locked flakeref to a url. The included patch adds the?hostquery back to the locked url.Release Notes
Fixes installing flakerefs pointing to custom github or gitlab instances via the
github:owner/name?host=internalgithub.company.comformat.