Skip to content

Commit 2994677

Browse files
committed
pulled upstream
2 parents e856460 + f3a5af4 commit 2994677

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1321
-5279
lines changed

devbox.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Package devbox creates and configures Devbox development environments.
2+
package devbox
3+
4+
import (
5+
"context"
6+
"io"
7+
8+
"go.jetpack.io/devbox/internal/devbox"
9+
"go.jetpack.io/devbox/internal/devbox/devopt"
10+
)
11+
12+
// Devbox is a Devbox development environment.
13+
type Devbox struct {
14+
dx *devbox.Devbox
15+
}
16+
17+
// Open loads a Devbox environment from a config file or directory.
18+
func Open(path string) (*Devbox, error) {
19+
dx, err := devbox.Open(&devopt.Opts{
20+
Dir: path,
21+
Stderr: io.Discard,
22+
})
23+
if err != nil {
24+
return nil, err
25+
}
26+
return &Devbox{dx: dx}, nil
27+
}
28+
29+
// Install downloads and installs missing packages.
30+
func (d *Devbox) Install(ctx context.Context) error {
31+
return d.dx.Install(ctx)
32+
}

docs/app/docs/installing_devbox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ curl -fsSL https://get.jetify.com/devbox | bash
2020

2121
Devbox requires the [Nix Package Manager](https://nixos.org/download.html). If Nix is not detected when running a command, Devbox will install it for you in single-user mode for Linux. Don't worry: You can use Devbox without needing to learn the Nix Language.
2222

23-
If you would like to install Nix yourself, we recommend the [Determinate Nix Installer](https://determinate.systems/posts/determinate-nix-installer/).
23+
If you would like to install Nix yourself, we recommend the [Determinate Nix Installer](https://determinate.systems/nix-installer/).
2424

2525
</TabItem>
2626
<TabItem value="macos" label="MacOS">

examples/databases/postgres/devbox.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"packages": {
3-
"postgresql": "latest",
4-
"glibcLocales": {
5-
"version": "latest",
6-
"platforms": ["x86_64-linux", "aarch64-linux"]
7-
}
3+
"postgresql": "latest"
84
},
95
"shell": {
106
"init_hook": null

examples/development/haskell/devbox.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"zlib@latest",
88
"hpack@latest"
99
],
10+
"env": {
11+
"PATH": "$PATH:/usr/bin"
12+
},
1013
"shell": {
1114
"init_hook": null,
1215
"scripts": {
@@ -17,4 +20,4 @@
1720
]
1821
}
1922
}
20-
}
23+
}

flake.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
let
1212
pkgs = nixpkgs.legacyPackages.${system};
1313

14-
lastTag = "0.13.6";
14+
lastTag = "0.13.7";
1515

1616
revision =
1717
if (self ? shortRev)
@@ -47,6 +47,9 @@
4747
"-X go.jetpack.io/devbox/internal/build.Commit=${revision}"
4848
];
4949

50+
# Don't generate test binaries (as we'd include them as a bin)
51+
excludedPackages = [ "testscripts" ];
52+
5053
# Disable tests if they require network access or are integration tests
5154
doCheck = false;
5255

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ require (
1414
github.com/aws/aws-sdk-go-v2/service/sts v1.28.11
1515
github.com/bmatcuk/doublestar/v4 v4.6.1
1616
github.com/briandowns/spinner v1.23.0
17-
github.com/cavaliergopher/grab/v3 v3.0.1
18-
github.com/cloudflare/ahocorasick v0.0.0-20210425175752-730270c3e184
1917
github.com/denisbrodbeck/machineid v1.0.1
2018
github.com/f1bonacc1/process-compose v1.6.1
2119
github.com/fatih/color v1.17.0
@@ -48,7 +46,6 @@ require (
4846
golang.org/x/oauth2 v0.21.0
4947
golang.org/x/sync v0.7.0
5048
golang.org/x/tools v0.22.0
51-
gopkg.in/natefinch/lumberjack.v2 v2.2.1
5249
gopkg.in/yaml.v3 v3.0.1
5350
)
5451

@@ -78,6 +75,7 @@ require (
7875
github.com/bodgit/sevenzip v1.5.1 // indirect
7976
github.com/bodgit/windows v1.0.1 // indirect
8077
github.com/buger/jsonparser v1.1.1 // indirect
78+
github.com/cavaliergopher/grab/v3 v3.0.1 // indirect
8179
github.com/charmbracelet/lipgloss v0.11.0 // indirect
8280
github.com/charmbracelet/x/ansi v0.1.2 // indirect
8381
github.com/cloudflare/circl v1.3.8 // indirect

go.sum

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

internal/boxcli/cloud.go

Lines changed: 0 additions & 176 deletions
This file was deleted.

internal/boxcli/featureflag/detsys.go

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/boxcli/generate.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/spf13/cobra"
1414

1515
"go.jetpack.io/devbox/internal/boxcli/usererr"
16-
"go.jetpack.io/devbox/internal/cloud"
1716
"go.jetpack.io/devbox/internal/devbox"
1817
"go.jetpack.io/devbox/internal/devbox/devopt"
1918
"go.jetpack.io/devbox/internal/devbox/docgen"
@@ -24,7 +23,6 @@ type generateCmdFlags struct {
2423
config configFlags
2524
force bool
2625
printEnvrcContent bool
27-
githubUsername string
2826
rootUser bool
2927
}
3028

@@ -61,7 +59,6 @@ func generateCmd() *cobra.Command {
6159
command.AddCommand(debugCmd())
6260
command.AddCommand(direnvCmd())
6361
command.AddCommand(genReadmeCmd())
64-
command.AddCommand(sshConfigCmd())
6562
flags.config.register(command)
6663

6764
return command
@@ -158,27 +155,6 @@ func direnvCmd() *cobra.Command {
158155
return command
159156
}
160157

161-
func sshConfigCmd() *cobra.Command {
162-
flags := &generateCmdFlags{}
163-
command := &cobra.Command{
164-
Use: "ssh-config",
165-
Hidden: true,
166-
Short: "Generate ssh config to connect to devbox cloud",
167-
Long: "Check ssh config and if they don't exist, it generates the configs necessary to connect to devbox cloud VMs.",
168-
Args: cobra.MaximumNArgs(0),
169-
RunE: func(cmd *cobra.Command, args []string) error {
170-
// ssh-config command is exception and it should run without a config file present
171-
_, err := cloud.SSHSetup(flags.githubUsername)
172-
return errors.WithStack(err)
173-
},
174-
}
175-
command.Flags().StringVarP(
176-
&flags.githubUsername, "username", "u", "", "GitHub username to use for ssh",
177-
)
178-
flags.config.register(command)
179-
return command
180-
}
181-
182158
func genReadmeCmd() *cobra.Command {
183159
flags := &GenerateReadmeCmdFlags{}
184160

0 commit comments

Comments
 (0)