Skip to content

Commit 3a1050a

Browse files
t-monaghant-monaghanmikeland73
authored
fixes reference to nixpkgs in pre fetch command (#2689)
## Summary Adding a flake reference is reporting an error when loading the devbox shell, however everything works as expected. The offending internal command is the prefetch here: https://github.com/t-monaghan/devbox/blob/eed56cd6e516bb86577c9abcaf421fe88c714296/internal/nix/nixpkgs.go#L40-L52 And the reported error I receive is: `error: getting status of '/Users/tom.monaghan/dev/scratch/nixpkgs/d7600c775f877cd87b4f5a831c28aa94137377aa': No such file or directory` This is due to the prefetch missing the `github:` prepended to the flake reference, and as such nix goes looking for a local copy of nixpkgs. ## How was it tested? With a devbox.json containing the below, I ran the build for this change and noticed no raised error, and the claude-code package I expected was available. ``` { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json", "packages": [ "github:NixOS/nixpkgs/nixos-unstable#claude-code" ], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" ], "scripts": { "test": [ "echo \"Error: no test specified\" && exit 1" ] } } } ``` ## Community Contribution License All community contributions in this pull request are licensed to the project maintainers under the terms of the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0). By creating this pull request, I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the [Community Contribution License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license). --------- Co-authored-by: t-monaghan <tom.monaghan@cultureamp.com> Co-authored-by: Mike Landau <mikeland86@gmail.com>
1 parent f6e5fbe commit 3a1050a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/nix/nix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func savePrintDevEnvCache(path string, out PrintDevEnvOut) error {
115115
func FlakeNixpkgs(commit string) string {
116116
// Using nixpkgs/<commit> means:
117117
// The nixpkgs entry in the flake registry, with its Git revision overridden to a specific value.
118-
return "nixpkgs/" + commit
118+
return "github:NixOS/nixpkgs/" + commit
119119
}
120120

121121
func ExperimentalFlags() []string {

0 commit comments

Comments
 (0)