Skip to content

Commit ce5e13f

Browse files
committed
pull upstream
2 parents 18d23de + 3f7706d commit ce5e13f

File tree

8 files changed

+41
-18
lines changed

8 files changed

+41
-18
lines changed

.schema/devbox.schema.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,15 @@
239239
},
240240
"env_from": {
241241
"type": "string"
242-
}
243-
},
244-
"additionalProperties": false
245-
}
242+
},
243+
"nixpkgs": {
244+
"type": "object",
245+
"properties": {
246+
"commit": {
247+
"type": "string",
248+
"description": "The commit hash of the nixpkgs repository to use"
249+
}
250+
}
251+
},
252+
"additionalProperties": false
253+
}

docs/app/docs/guides/plugins.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Sometimes, you may want to share a plugin across multiple projects or users. In
5757
]
5858
```
5959

60+
Note that Devbox will cache Github plugins for 24 hours. This is to aid performance of `devbox shell` and similar commands, and avoids downloading the plugin from Github each time. In extenuating circumstances, you can bypass this cache by setting `export DEVBOX_X_GITHUB_PLUGIN_CACHE_TTL=<time>` , where time is a valid input to `time.ParseDuration` (see [doc](https://pkg.go.dev/time#ParseDuration)) such as "120s" or "2m".
61+
6062
## An Example of a Plugin: Nginx
6163
Let's take a look at the plugin for Nginx. To get started, let's initialize a new devbox project, and add the `nginx` package:
6264

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/fatih/color v1.17.0
2020
github.com/fsnotify/fsnotify v1.7.0
2121
github.com/getsentry/sentry-go v0.28.0
22-
github.com/go-jose/go-jose/v4 v4.0.2
22+
github.com/go-jose/go-jose/v4 v4.0.4
2323
github.com/google/go-cmp v0.6.0
2424
github.com/google/uuid v1.6.0
2525
github.com/hashicorp/go-envparse v0.1.0
@@ -44,7 +44,7 @@ require (
4444
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
4545
golang.org/x/mod v0.18.0
4646
golang.org/x/oauth2 v0.21.0
47-
golang.org/x/sync v0.7.0
47+
golang.org/x/sync v0.10.0
4848
golang.org/x/tools v0.22.0
4949
gopkg.in/yaml.v3 v3.0.1
5050
)
@@ -128,9 +128,9 @@ require (
128128
github.com/ulikunitz/xz v0.5.12 // indirect
129129
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
130130
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
131-
golang.org/x/crypto v0.24.0 // indirect
132-
golang.org/x/sys v0.21.0 // indirect
133-
golang.org/x/term v0.21.0 // indirect
134-
golang.org/x/text v0.16.0 // indirect
131+
golang.org/x/crypto v0.32.0 // indirect
132+
golang.org/x/sys v0.29.0 // indirect
133+
golang.org/x/term v0.28.0 // indirect
134+
golang.org/x/text v0.21.0 // indirect
135135
google.golang.org/protobuf v1.34.1 // indirect
136136
)

go.sum

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/boxcli/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func searchCmd() *cobra.Command {
3333
query := args[0]
3434
name, version, isVersioned := searcher.ParseVersionedPackage(query)
3535
if !isVersioned {
36-
results, err := searcher.Client().Search(query)
36+
results, err := searcher.Client().Search(cmd.Context(), query)
3737
if err != nil {
3838
return err
3939
}

internal/devbox/devbox.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ func (d *Devbox) ListScripts() []string {
345345
keys[i] = k
346346
i++
347347
}
348+
349+
slices.Sort(keys)
350+
348351
return keys
349352
}
350353

internal/searcher/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func Client() *client {
3232
}
3333
}
3434

35-
func (c *client) Search(query string) (*SearchResults, error) {
35+
func (c *client) Search(ctx context.Context, query string) (*SearchResults, error) {
3636
if query == "" {
3737
return nil, fmt.Errorf("query should not be empty")
3838
}
@@ -43,7 +43,7 @@ func (c *client) Search(query string) (*SearchResults, error) {
4343
}
4444
searchURL := endpoint + "?q=" + url.QueryEscape(query)
4545

46-
return execGet[SearchResults](context.TODO(), searchURL)
46+
return execGet[SearchResults](ctx, searchURL)
4747
}
4848

4949
// Resolve calls the /resolve endpoint of the search service. This returns

vendor-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sha256-xsx+bFjvYpLYE+Sok+4zlsK6i9QLg04fdWQoN5zC2CY=
1+
sha256-og8FrWOC3Cq3KucXYcpiI1BHQS9kRPQkxyaDypFYdn0=

0 commit comments

Comments
 (0)