Skip to content

Commit 0467e39

Browse files
authored
[remove nixpkgs] enable fallback for packages not in binary store (#1236)
## Summary Many testscript unit-tests were failing because they use unversioned legacy packages like `"hello"`, as opposed to `hello@latest`, or `hello@<version>`. These legacy packages do not use the Binary Cache Store. I considered whether we should treat them automatically as upgraded to `@latest`, but decided against: 1. We'll need this logic in the flake template regardless. There will be some packages that are not in binary store. 2. This also keeps the `Package.IsInBinaryStore` easier to reason about. We should instead encourage users to `devbox update` their packages: which our messaging already does. The remaining three testscript unit-tests are failing due to "unable to find nix executable" errors. Will fix in followup. ## How was it tested? enabled feature-flag and ran testscripts: https://github.com/jetpack-io/devbox/actions/runs/5417704606/jobs/9848964717?pr=1236
1 parent 6c833de commit 0467e39

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/shellgen/tmpl/flake_remove_nixpkgs.nix.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
}:
1818
let
1919
pkgs = nixpkgs.legacyPackages.{{ .System }};
20+
{{- range .FlakeInputs }}
21+
{{- if .IsNixpkgs }}
22+
{{.PkgImportName}} = (import {{.Name}} {
23+
system = "{{ $.System }}";
24+
config.allowUnfree = true;
25+
});
26+
{{- end }}
27+
{{- end }}
2028
in
2129
{
2230
devShells.{{ .System }}.default = pkgs.mkShell {

0 commit comments

Comments
 (0)