You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attach to a running instance of `devbox services`. This command lets you launch the TUI for process-compose if you started your services in the background with `devbox services up -b`.
4
+
5
+
Note that terminating the TUI will not stop your backgrounded services. To stop your services, use `devbox services stop`.
6
+
7
+
```bash
8
+
devbox services attach [flags]
9
+
```
10
+
11
+
## Options
12
+
13
+
<!-- Markdown Table of Options -->
14
+
| Option | Description |
15
+
| --- | --- |
16
+
|`-h, --help`| help for ls |
17
+
|`-q, --quiet`| Quiet mode: Suppresses logs. |
18
+
19
+
### SEE ALSO
20
+
21
+
*[devbox services](devbox_services.md) - Interact with devbox services
Copy file name to clipboardExpand all lines: docs/app/docs/cli_reference/devbox_services_up.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,11 @@ devbox services up web
31
31
|`-e, --env stringToString`| environment variables to set in the devbox environment (default []) |
32
32
|`--env-file string`| path to a file containing environment variables to set in the devbox environment |
33
33
|`-h, --help`| help for up |
34
+
|`--pcflags stringArray`| additional flags to pass directly to process-compose |
35
+
|`-p, --pcport int`| specify the port for process-compose to use. You can also set the pcport by exporting DEVBOX_PC_PORT_NUM |
34
36
|`--process-compose-file string`| path to process compose file or directory containing process compose-file.yaml\|yml. Default is directory containing devbox.json |
35
37
|`-q, --quiet`| Quiet mode: Suppresses logs. |
36
38
37
39
## SEE ALSO
38
40
39
41
*[devbox services](devbox_services.md) - Interact with devbox services
Copy file name to clipboardExpand all lines: docs/app/docs/configuration.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,14 +36,16 @@ Packages can be structured as a list of package names (`<packages>@<version>`) o
36
36
37
37
If you need to provide more options to your packages (such as limiting which platforms will install the package), you can structure packages as a map, where each package follows the schema below:
38
38
39
-
```json
39
+
```js
40
40
{
41
41
"packages": {
42
42
// If only a version is specified, you can abbreviate the maps as "package_name": "version"
43
43
"package_name": string,
44
44
"package_name": {
45
45
// Version of the package to install. Defaults to "latest"
46
46
"version": string,
47
+
// Whether native library patching is enabled for this package. This defaults to `auto`, but can be overridden to `always` or `never` for individual packages.
48
+
"patch": ["auto"|"always"|"never"],
47
49
// List of platforms to install the package on. Defaults to all platforms
48
50
"platforms": [string],
49
51
// List of platforms to exclude this package from. Defaults to no excluded platforms
@@ -244,9 +246,9 @@ To run multiple commands in a single script, you can pass them as an array:
244
246
245
247
### Include
246
248
247
-
Includes can be used to explicitly add extra configuration from [plugins](./guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.
249
+
Includes can be used to explicitly add extra configuration from [plugins](./guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.
248
250
249
-
Note that in the event of a conflict, plugins near the end of the list will override plugins at the beginning of the list. Likewise, if a setting in your project config conflicts with a plugin (e.g., your `devbox.json` has a script with the same name as a plugin script), your project config will take precedence.
251
+
Note that in the event of a conflict, plugins near the end of the list will override plugins at the beginning of the list. Likewise, if a setting in your project config conflicts with a plugin (e.g., your `devbox.json` has a script with the same name as a plugin script), your project config will take precedence.
Thw following is a list of Environment variables used by Devbox to manage your environment. Some of these variables are set by Devbox, while others can be used to manage how Devbox sets up your shell.
6
+
7
+
Note that
8
+
9
+
## Environment Variables Set by Devbox Shell
10
+
11
+
Below are some useful environment variables that Devbox sets up for you. These variables can be used in your scripts to access information or write scripts for your current project environment.
12
+
13
+
| Variable | Description |
14
+
|:--------|:-----------|
15
+
|`DEVBOX_CONFIG_DIR`| The directory where Devbox stores user-editable config files for your project's packages. These files can be checked into source control|
16
+
|`DEVBOX_PACKAGES_DIR`| The directory containing the binaries and files for the packages in your current project.|
17
+
|`DEVBOX_PROJECT_ROOT`| The root directory of your current project. This will match the directory location of the `devbox.json` file for your currently running shell |
18
+
|`DEVBOX_PURE_SHELL`| Indicates whether you are running your current shell in pure mode. Pure mode clears your current environment variables before starting a devbox shell |
19
+
|`DEVBOX_SHELL_ENABLED`| Whether or not Devbox is enabled in the current shell. This is automatically set to `1` when you start a shell, run a script, or start services |
20
+
|`DEVBOX_WD`| Your current working directory. This can be used when writing scripts that you want to run in your current directory, instead of DEVBOX_PROJECT_ROOT |
21
+
22
+
23
+
## Environment Variables for Managing Devbox
24
+
25
+
Below are some environment variables that can be used to manage how Devbox sets up your shell. These variables can be set in your shell or in your `devbox.json` file.
26
+
27
+
| Variable | Description | Value |
28
+
|:--------|:-----------|:------------|
29
+
|`DEVBOX_DEBUG`| Enable debug output for Devbox. If set to 1, this will print out additional information about what Devbox is doing. | 0 |
30
+
|`DEVBOX_FEATURE_DETSYS_INSTALLER`| If enabled, Devbox will use the Determinate Systems installer to setup Nix on your system. | 0 |
31
+
|`DEVBOX_NO_PROMPT`| Disables the default shell prompt modification for Devbox. Usually used if you want to configure your own prompt for indicating that you are in a devbox sell | 0 |
32
+
|`DEVBOX_PC_PORT_NUM`| Sets the port number for process-compose when running Devbox services. If this variable is unset and a port is not provided via the CLI, Devbox will choose a random available port |`unset`|
33
+
|`DEVBOX_USE_VERSION`| Setting this variable will force Devbox to use a different version than the current latest. For example: `DEVBOX_USE_VERSION=0.13.0` will install and use Devbox v0.13 for all Devbox commands|`unset`|
Copy file name to clipboardExpand all lines: docs/app/docs/faq.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,52 +31,52 @@ Yes! Devbox can be installed on any Linux distribution, including NixOS. You can
31
31
32
32
## A package I installed is missing header files or libraries I need for development. Where do I find them?
33
33
34
-
In order to save space, Devbox and Nix only install the required components of packages by default. Development header files and libraries are often installed in a separate output of the package (usually `dev`), which can be installed using the `--output` flag on the `devbox add` command.
34
+
In order to save space, Devbox and Nix only install the required components of packages by default. Development header files and libraries are often installed in a separate output of the package (usually `dev`), which can be installed using the `--output` flag on the `devbox add` command.
35
35
36
-
For example, the command below will install both the default output `out`, and the `cli` output for the prometheus package:
36
+
For example, the command below will install both the default output `out`, and the `cli` output for the prometheus package:
37
37
38
38
```bash
39
39
devbox add prometheus --outputs=out,cli
40
40
```
41
41
42
-
You can also specify non-default outputs in [flake references](./guides/using_flakes.md):
42
+
You can also specify non-default outputs in [flake references](./guides/using_flakes.md):
## One of my project's packages is taking a long time to install. How can I speed up the installation process?
49
49
50
-
Packages may take a long time to install if they do not have a binary available in the public Nix Cache. If a prebuilt binary is not available, Nix will built the package from source.
50
+
Packages may take a long time to install if they do not have a binary available in the public Nix Cache. If a prebuilt binary is not available, Nix will built the package from source.
51
51
52
52
If prebuilt binaries are not available in the public cache, you may want to use the [Jetify Cache](./cloud/cache/index.md) or the [Jetify Prebuilt Cache](./cloud/cache/prebuilt_cache.md) to cache the binaries you build for future use. Using a package cache can reduce package install by up to 90% compared to building from source.
53
53
54
54
## I'm trying to build a project, but it says that I'm missing `libstdc++`. How do I install this library in my project?
55
55
56
-
This message means that your project requires an implementation of the C++ Standard Library installed and linked within your shell. You can add the libstdc++ libraries and object files using `devbox add stdenv.cc.cc.lib`.
56
+
This message means that your project requires an implementation of the C++ Standard Library installed and linked within your shell. You can add the libstdc++ libraries and object files using `devbox add stdenv.cc.cc.lib`.
57
57
58
-
## I'm seeing a ``GLIBC_X.XX' not found` error when I try to install my packages, or when I install packages from PyPi/RubyGems/NPM/Cargo/other package manager in my shell
58
+
## I'm seeing errors like ``GLIBC_X.XX' not found` when I try to install my packages, or when I install packages from PyPi/RubyGems/NPM/Cargo/other package manager in my shell
59
59
60
-
This message usually occurs when using older packages, or when mixing different versions of packages within a single shell. The error tends to occur because each Nix package comes bundled with all of it's dependencies, including a version of the C Standard Library, to ensure reproducibility. If your interpreter (Python/Ruby/Node) or runtime is using an older version of `glibc` than what your other packages expect, they will throw this error.
60
+
This message usually occurs when using older packages, or when mixing different versions of packages within a single shell. The error tends to occur because each Nix package comes bundled with all of it's dependencies, including a version of the C Standard Library, to ensure reproducibility. If your interpreter (Python/Ruby/Node) or runtime is using an older version of `glibc` than what your other packages expect, they will throw this error.
61
61
62
-
There are three ways to work around this issue:
63
-
1. You can update your packages to use a newer version (using `devbox add`). This newer version will likely come bundled with a newer version of `glibc`.
62
+
There are three ways to work around this issue:
63
+
1. You can update your packages to use a newer version (using `devbox add`). This newer version will likely come bundled with a newer version of `glibc`.
64
64
2. You can use `devbox update` to get the latest Nix derivation for your package. Newer derivations may come bundled with newer dependencies, including `glibc`
65
-
3. If you need to use an exact package version, but you still see this error, you can patch it to use a newer version of glibc using `devbox add <package>@<version> --patch-glibc`. This will patch your package to use a newer version of glibc, which should resolve any incompatibility issues you might be seeing. **This patch will only affect packages on Linux.**
65
+
3. If you need to use an exact package version, but you still see this error, you can patch it to use a newer version of glibc using `devbox add <package>@<version> --patch always`. This will patch your package to use the latest version of glibc available in the Nix store, as well as patching it to use any native libraries you have installed with Devbox.
66
66
67
67
## How can I use custom Nix packages or overrides with Devbox?
68
68
69
69
You can add customized packages to your Devbox environment using our [Flake support](./guides/using_flakes.md). You can use these flakes to modify or override packages from nixpkgs, or to create your own custom packages.
70
70
71
71
## Can I use Devbox if I use [Fish](https://fishshell.com/)?
72
72
73
-
Yes. In addition to supporting POSIX compliant shells like Zsh and Bash, Devbox also works with Fish.
73
+
Yes. In addition to supporting POSIX compliant shells like Zsh and Bash, Devbox also works with Fish.
74
74
75
-
Note that `init_hooks` in Devbox will be run directly in your host shell, so you may have encounter some compatibility issues if you try to start a shell that uses a POSIX-compatible script in the init_hook.
75
+
Note that `init_hooks` in Devbox will be run directly in your host shell, so you may have encounter some compatibility issues if you try to start a shell that uses a POSIX-compatible script in the init_hook.
76
76
77
77
## How can I rollback to a previous version of Devbox?
78
78
79
-
You can use any previous version of Devbox by setting the `DEVBOX_USE_VERSION` environment variable. For example, to use version 0.8.0, you can run the following or add it to your shell's rcfile:
79
+
You can use any previous version of Devbox by setting the `DEVBOX_USE_VERSION` environment variable. For example, to use version 0.8.0, you can run the following or add it to your shell's rcfile:
80
80
81
81
```bash
82
82
export DEVBOX_USE_VERSION=0.8.0
@@ -92,7 +92,12 @@ By default, Devbox will prefix your prompt with `(devbox)` when inside a `devbox
92
92
DEVBOX_NO_PROMPT=true
93
93
```
94
94
95
-
You can now detect being inside a `devbox shell` and change your prompt using the method of your choosing.
Copy file name to clipboardExpand all lines: docs/app/docs/guides/services.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,16 @@ You can also start a specific service by passing the name as an argument. For ex
16
16
17
17
If you want to restart your services (for example, after changing your configuration), you can run `devbox services restart`
18
18
19
+
## Starting your Services in the Background
20
+
21
+
If you want to start your services in the background, without launching the process-compose TUI, you can use the `-b` flag. For example, to start all services in the background, you can run `devbox services up -b`.
22
+
23
+
Services started in the background will continue running, even if the current shell is closed. To stop your backgrounded services, run `devbox services stop`.
24
+
25
+
To see the current state of your running services, you can run `devbox services ls`.
26
+
27
+
You can also attach the process-compose TUI to your running background services by running `devbox services attach`.
28
+
19
29
## Defining your Own Services
20
30
21
31
If you have a process or service that you want to run with your Devbox project, you can define it using a process-compose.yml in your project's root directory. For example, if you want to run a Django server, you could add the following yaml:
@@ -76,8 +86,6 @@ You can stop your services with `devbox services stop`. This will stop process-c
76
86
77
87
If you want to stop a specific service, you can pass the name as an argument. For example, to stop just `postgresql`, you can run `devbox services stop postgresql`
Copy file name to clipboardExpand all lines: docs/app/docs/installing_devbox.mdx
+28-8Lines changed: 28 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';
9
9
10
10
Select your OS below for the steps to install Devbox.
11
11
12
-
<Tabs>
12
+
<TabsqueryString="install-method">
13
13
<TabItemvalue="linux"label="Linux">
14
14
15
15
Run the following install script as a *non-root user* to install the latest version of Devbox:
@@ -39,7 +39,7 @@ If you would like to install Nix yourself, we recommend the [Determinate Nix Ins
39
39
40
40
<TabItemvalue="wsl"label="Windows/WSL2">
41
41
42
-
You can use Devbox on a Windows machine using [**Windows Subsystem for Linux 2**](https://learn.microsoft.com/en-us/windows/wsl/install).
42
+
You can use Devbox on a Windows machine using [**Windows Subsystem for Linux 2**](https://learn.microsoft.com/en-us/windows/wsl/install).
43
43
44
44
<details>
45
45
<summary>Installing WSL2</summary>
@@ -71,7 +71,7 @@ Devbox requires the [Nix Package Manager](https://nixos.org/download/). If Nix i
71
71
72
72
<TabItemvalue="nix"label="NixOS/Nixpkg">
73
73
74
-
Devbox is available through the [**Nix Package Manager**](https://search.nixos.org/packages?channel=unstable&show=devbox&from=0&size=50&sort=relevance&type=packages&query=devbox).
74
+
Devbox is available through the [**Nix Package Manager**](https://search.nixos.org/packages?channel=unstable&show=devbox&from=0&size=50&sort=relevance&type=packages&query=devbox).
75
75
76
76
To install on NixOS:
77
77
@@ -85,34 +85,54 @@ To install on a non NixOS:
85
85
nix-env -iA nixpkgs.devbox
86
86
```
87
87
88
-
or
88
+
or
89
89
90
90
```bash
91
91
nix profile install nixpkgs#devbox
92
92
```
93
93
94
+
Note: New releases of Devbox need to be updated in Nixpkgs before they are available for installation. If you want to use the latest version of Devbox, you can install it using the [Nix Flake](.?install-method=flake).
95
+
96
+
</TabItem>
97
+
<TabItemvalue="flake"label="Nix Flake">
98
+
99
+
You can also install Devbox on a NixOS/Nixpkgs system using our Nix Flake. Using the Nix Flake can help you access pre-releases and final releases of Devbox as soon as they are published.
Devbox will notify you when a new version is available. To update to the latest released version of Devbox, you can run `devbox version update`.
119
+
Devbox will notify you when a new version is available. To update to the latest released version of Devbox, you can run `devbox version update`.
100
120
101
121
If you installed Devbox with Nix, you can update Devbox via Nix using `nix-env -u devbox`, or `nix profile upgrade`.
102
122
103
123
You can find release notes and details on the [Releases page](https://github.com/jetify-com/devbox/releases) of the Devbox Github repo.
104
124
105
125
## Rolling Back or Pinning a Specific Version of Devbox
106
126
107
-
You can rollback or pin the version of Devbox on your system using the `DEVBOX_USE_VERSION` environment variable. For example, to use version 0.8.0:
127
+
You can rollback or pin the version of Devbox on your system using the `DEVBOX_USE_VERSION` environment variable. For example, to use version 0.8.0:
108
128
109
129
```bash
110
130
export DEVBOX_USE_VERSION=0.8.0
111
131
```
112
132
113
-
Setting this variable will use the specified version of Devbox even if a newer version has been installed on your machine.
133
+
Setting this variable will use the specified version of Devbox even if a newer version has been installed on your machine.
114
134
115
-
If you installed Devbox with Nixpkgs, you will need to pin Devbox in your profile or Nix configuration. You can find the Nixpkg commits for previous versions of Devbox on [Nixhub](https://www.nixhub.io/packages/devbox).
135
+
If you installed Devbox with Nixpkgs, you will need to pin Devbox in your profile or Nix configuration. You can find the Nixpkg commits for previous versions of Devbox on [Nixhub](https://www.nixhub.io/packages/devbox).
0 commit comments