Skip to content

Commit 45f8d66

Browse files
authored
[cleanup] remove overlays code from generated nix files (#538)
## Summary This has not been used for many months now... ## How was it tested?
1 parent 130733d commit 45f8d66

File tree

5 files changed

+1
-24
lines changed

5 files changed

+1
-24
lines changed

internal/impl/devbox_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ func assertShellPlansMatch(t *testing.T, expected *plansdk.ShellPlan, actual *pl
6767
assert := assert.New(t)
6868

6969
assert.ElementsMatch(expected.DevPackages, actual.DevPackages, "DevPackages should match")
70-
assert.ElementsMatch(expected.NixOverlays, actual.NixOverlays, "NixOverlays should match")
7170
}
7271

7372
func fileExists(path string) bool {

internal/impl/tmpl/development.nix.tmpl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ let
55
sha256 = "{{ .NixpkgsInfo.Sha256 }}";
66
{{- end }}
77
}) {
8-
{{- if .NixOverlays }}
9-
overlays = [
10-
{{- range .NixOverlays }}
11-
(import (fetchTarball "{{.}}"))
12-
{{ end -}}
13-
];
14-
{{- end }}
158
};
169
{{- range .Definitions}}
1710
{{.}}

internal/impl/tmpl/shell.nix.tmpl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ let
55
sha256 = "{{ .NixpkgsInfo.Sha256 }}";
66
{{- end }}
77
}) {
8-
{{- if .NixOverlays }}
9-
overlays = [
10-
{{- range .NixOverlays }}
11-
(import (fetchTarball "{{.}}"))
12-
{{ end -}}
13-
];
14-
{{- end }}
158
};
169
{{- range .Definitions}}
1710
{{.}}

internal/planner/plansdk/plansdk.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ type ShellPlan struct {
3333
DevPackages []string `cue:"[...string]" json:"dev_packages,omitempty"`
3434
// Init hook on shell start. Currently, Nginx and python pip planners need it for shell.
3535
ShellInitHook []string `cue:"[...string]" json:"shell_init_hook,omitempty"`
36-
// Nix overlays. Currently, Rust needs it for shell.
37-
NixOverlays []string `cue:"[...string]" json:"nix_overlays,omitempty"`
3836
// Nix expressions. Currently, PHP needs it for shell.
3937
Definitions []string `cue:"[...string]" json:"definitions,omitempty"`
4038
// GeneratedFiles is a map of name => content for files that should be generated
@@ -54,7 +52,7 @@ type PlannerForPackages interface {
5452
}
5553

5654
// MergeShellPlans merges multiple Plans into one. The merged plan's packages, definitions,
57-
// and overlays is the union of the packages, definitions, and overlays of the input plans,
55+
// and shellInitHooks is the union of the packages, definitions, and shellInitHooks of the input plans,
5856
// respectively.
5957
func MergeShellPlans(plans ...*ShellPlan) (*ShellPlan, error) {
6058
shellPlan := &ShellPlan{}
@@ -67,7 +65,6 @@ func MergeShellPlans(plans ...*ShellPlan) (*ShellPlan, error) {
6765

6866
shellPlan.DevPackages = pkgslice.Unique(shellPlan.DevPackages)
6967
shellPlan.Definitions = pkgslice.Unique(shellPlan.Definitions)
70-
shellPlan.NixOverlays = pkgslice.Unique(shellPlan.NixOverlays)
7168
shellPlan.ShellInitHook = pkgslice.Unique(shellPlan.ShellInitHook)
7269

7370
return shellPlan, nil

internal/planner/plansdk/plansdk_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ func TestMergeShellPlans(t *testing.T) {
1414
plan2 := &ShellPlan{
1515
DevPackages: []string{},
1616
Definitions: []string{"a"},
17-
NixOverlays: []string{"b"},
1817
ShellInitHook: []string{"a", "b"},
1918
GeneratedFiles: map[string]string{
2019
"a": "b",
@@ -28,18 +27,15 @@ func TestMergeShellPlans(t *testing.T) {
2827
// Test merge array
2928
plan1 = &ShellPlan{
3029
Definitions: []string{"a"},
31-
NixOverlays: []string{"b"},
3230
ShellInitHook: []string{"c"},
3331
}
3432
plan2 = &ShellPlan{
3533
Definitions: []string{"a"},
36-
NixOverlays: []string{"a"},
3734
ShellInitHook: []string{"a", "b"},
3835
}
3936
expected = &ShellPlan{
4037
DevPackages: []string{},
4138
Definitions: []string{"a"},
42-
NixOverlays: []string{"b", "a"},
4339
ShellInitHook: []string{"c", "a", "b"},
4440
}
4541
actual, err = MergeShellPlans(plan1, plan2)
@@ -63,7 +59,6 @@ func TestMergeShellPlans(t *testing.T) {
6359
expected = &ShellPlan{
6460
DevPackages: []string{},
6561
Definitions: []string{},
66-
NixOverlays: []string{},
6762
ShellInitHook: []string{},
6863
GeneratedFiles: map[string]string{
6964
"a": "b",

0 commit comments

Comments
 (0)