From 475398afa61f8639dd5020078831aa484e1c45a1 Mon Sep 17 00:00:00 2001 From: t-monaghan Date: Mon, 1 Sep 2025 11:29:08 +1000 Subject: [PATCH 1/3] fixes reference to nixpkgs in pre fetch command --- internal/nix/nix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/nix/nix.go b/internal/nix/nix.go index 0f858d17dea..3335edb795d 100644 --- a/internal/nix/nix.go +++ b/internal/nix/nix.go @@ -112,7 +112,7 @@ func savePrintDevEnvCache(path string, out PrintDevEnvOut) error { func FlakeNixpkgs(commit string) string { // Using nixpkgs/ means: // The nixpkgs entry in the flake registry, with its Git revision overridden to a specific value. - return "nixpkgs/" + commit + return "github:nixpkgs/" + commit } func ExperimentalFlags() []string { From 66c38f658bd037a285a5f89b6e9cf25e434315bb Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Mon, 27 Oct 2025 15:07:15 -0700 Subject: [PATCH 2/3] fix flake referece, add test --- devbox.lock | 4 ++++ internal/nix/nix.go | 2 +- internal/nix/nix_test.go | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/devbox.lock b/devbox.lock index 1a55708dc78..4bb4406009b 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,6 +1,10 @@ { "lockfile_version": "1", "packages": { + "github:NixOS/nixpkgs/nixpkgs-unstable": { + "last_modified": "2025-10-23T16:27:14Z", + "resolved": "github:NixOS/nixpkgs/d5faa84122bc0a1fd5d378492efce4e289f8eac1?lastModified=1761236834&narHash=sha256-%2Bpthv6hrL5VLW2UqPdISGuLiUZ6SnAXdd2DdUE%2BfV2Q%3D" + }, "go@latest": { "last_modified": "2024-03-06T17:57:40Z", "resolved": "github:NixOS/nixpkgs/58ae79ea707579c40102ddf62d84b902a987c58b#go_1_22", diff --git a/internal/nix/nix.go b/internal/nix/nix.go index 3335edb795d..836c5bdd5d0 100644 --- a/internal/nix/nix.go +++ b/internal/nix/nix.go @@ -112,7 +112,7 @@ func savePrintDevEnvCache(path string, out PrintDevEnvOut) error { func FlakeNixpkgs(commit string) string { // Using nixpkgs/ means: // The nixpkgs entry in the flake registry, with its Git revision overridden to a specific value. - return "github:nixpkgs/" + commit + return "github:NixOS/nixpkgs/" + commit } func ExperimentalFlags() []string { diff --git a/internal/nix/nix_test.go b/internal/nix/nix_test.go index 67d486d3afa..9ed386d90b8 100644 --- a/internal/nix/nix_test.go +++ b/internal/nix/nix_test.go @@ -66,3 +66,21 @@ func TestParseInsecurePackagesFromExitError(t *testing.T) { t.Errorf("Expected package 'python-2.7.18.7', got %s", packages[0]) } } + +func TestFlakeNixpkgs(t *testing.T) { + // Test that FlakeNixpkgs returns the expected string given a commit hash. + commit := "123456abcdef" + expected := "github:NixOS/nixpkgs/123456abcdef" + result := FlakeNixpkgs(commit) + if result != expected { + t.Errorf("FlakeNixpkgs(%q) = %q, want %q", commit, result, expected) + } + + // Test with an empty string + commit = "" + expected = "github:NixOS/nixpkgs/" + result = FlakeNixpkgs(commit) + if result != expected { + t.Errorf("FlakeNixpkgs(empty string) = %q, want %q", result, expected) + } +} From 0bfeb7fdac7330ef6cd4df011439ffa4a26e6f1d Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Wed, 29 Oct 2025 09:34:04 -0700 Subject: [PATCH 3/3] remove test --- internal/nix/nix_test.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/internal/nix/nix_test.go b/internal/nix/nix_test.go index 5ef89d73b14..f43c405346d 100644 --- a/internal/nix/nix_test.go +++ b/internal/nix/nix_test.go @@ -68,21 +68,3 @@ func TestParseInsecurePackagesFromExitError(t *testing.T) { t.Errorf("Expected package 'python-2.7.18.7', got %s", packages[0]) } } - -func TestFlakeNixpkgs(t *testing.T) { - // Test that FlakeNixpkgs returns the expected string given a commit hash. - commit := "123456abcdef" - expected := "github:NixOS/nixpkgs/123456abcdef" - result := FlakeNixpkgs(commit) - if result != expected { - t.Errorf("FlakeNixpkgs(%q) = %q, want %q", commit, result, expected) - } - - // Test with an empty string - commit = "" - expected = "github:NixOS/nixpkgs/" - result = FlakeNixpkgs(commit) - if result != expected { - t.Errorf("FlakeNixpkgs(empty string) = %q, want %q", result, expected) - } -}