Skip to content

Commit 19a946a

Browse files
committed
Update docs for 0.13 series
1 parent fcf3a42 commit 19a946a

File tree

9 files changed

+135
-40
lines changed

9 files changed

+135
-40
lines changed

docs/app/docs/cli_reference/devbox_add.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ devbox add prometheus --outputs=out,cli
3333
| `--environment string` | Jetify Secrets environment to use, when supported (e.g.secrets support dev, prod, preview.) (default "dev") |
3434
| `-e, --exclude-platform strings` | exclude packages from a specific platform. |
3535
| `-h, --help` | help for add |
36-
| `-o, --outputs strings` | specify the outputs to install for the nix package |
36+
| `-o, --outputs strings` | specify the outputs to install for the nix package |
3737
| `-p`, `--platform strings` | install packages only on specific platforms. |
38-
| `--patch-glibc` | Patches ELF binaries to use a newer version of `glibc` |
38+
| `--patch` | Allow Devbox to patch your packages to fix issues with missing native libraries (auto, always, never) (default "auto")|
3939
| `-q, --quiet` | quiet mode: Suppresses logs. |
4040

4141
Valid Platforms include:
@@ -54,4 +54,3 @@ The platforms below are also supported, but will build packages from source
5454
## SEE ALSO
5555

5656
* [devbox](./devbox.md) - Instant, easy, predictable shells and containers
57-
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# devbox services attach
2+
3+
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

docs/app/docs/cli_reference/devbox_services_up.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ devbox services up web
3131
| `-e, --env stringToString` | environment variables to set in the devbox environment (default []) |
3232
| `--env-file string` | path to a file containing environment variables to set in the devbox environment |
3333
| `-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 |
3436
| `--process-compose-file string` | path to process compose file or directory containing process compose-file.yaml\|yml. Default is directory containing devbox.json |
3537
| `-q, --quiet` | Quiet mode: Suppresses logs. |
3638

3739
## SEE ALSO
3840

3941
* [devbox services](devbox_services.md) - Interact with devbox services
40-

docs/app/docs/configuration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ Packages can be structured as a list of package names (`<packages>@<version>`) o
3636

3737
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:
3838

39-
```json
39+
```js
4040
{
4141
"packages": {
4242
// If only a version is specified, you can abbreviate the maps as "package_name": "version"
4343
"package_name": string,
4444
"package_name": {
4545
// Version of the package to install. Defaults to "latest"
4646
"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"],
4749
// List of platforms to install the package on. Defaults to all platforms
4850
"platforms": [string],
4951
// 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:
244246

245247
### Include
246248

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.
248250

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.
250252
```json
251253
{
252254
"include": [

docs/app/docs/env_variables.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Devbox Env Variables
3+
---
4+
5+
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`|

docs/app/docs/faq.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,52 +31,52 @@ Yes! Devbox can be installed on any Linux distribution, including NixOS. You can
3131

3232
## A package I installed is missing header files or libraries I need for development. Where do I find them?
3333

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.
3535

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:
3737

3838
```bash
3939
devbox add prometheus --outputs=out,cli
4040
```
4141

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):
4343

4444
```bash
4545
devbox add github:NixOS/nixpkgs#prometheus^out,cli
4646
```
4747

4848
## One of my project's packages is taking a long time to install. How can I speed up the installation process?
4949

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.
5151

5252
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.
5353

5454
## I'm trying to build a project, but it says that I'm missing `libstdc++`. How do I install this library in my project?
5555

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`.
5757

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
5959

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.
6161

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`.
6464
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.
6666

6767
## How can I use custom Nix packages or overrides with Devbox?
6868

6969
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.
7070

7171
## Can I use Devbox if I use [Fish](https://fishshell.com/)?
7272

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.
7474

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.
7676

7777
## How can I rollback to a previous version of Devbox?
7878

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:
8080

8181
```bash
8282
export DEVBOX_USE_VERSION=0.8.0
@@ -92,7 +92,12 @@ By default, Devbox will prefix your prompt with `(devbox)` when inside a `devbox
9292
DEVBOX_NO_PROMPT=true
9393
```
9494

95-
You can now detect being inside a `devbox shell` and change your prompt using the method of your choosing.
95+
If you are using Fish:
96+
97+
```fish
98+
set -U devbox_no_prompt true
99+
```
100+
96101

97102
## How can I uninstall Devbox?
98103

docs/app/docs/guides/services.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ You can also start a specific service by passing the name as an argument. For ex
1616

1717
If you want to restart your services (for example, after changing your configuration), you can run `devbox services restart`
1818

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+
1929
## Defining your Own Services
2030

2131
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
7686

7787
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`
7888

79-
80-
8189
## Further Reading
8290

8391
* [**Devbox Services CLI Reference**](../cli_reference/devbox_services.md)

docs/app/docs/installing_devbox.mdx

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';
99

1010
Select your OS below for the steps to install Devbox.
1111

12-
<Tabs>
12+
<Tabs queryString="install-method">
1313
<TabItem value="linux" label="Linux">
1414

1515
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
3939

4040
<TabItem value="wsl" label="Windows/WSL2">
4141

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).
4343

4444
<details>
4545
<summary>Installing WSL2</summary>
@@ -71,7 +71,7 @@ Devbox requires the [Nix Package Manager](https://nixos.org/download/). If Nix i
7171

7272
<TabItem value="nix" label="NixOS/Nixpkg">
7373

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).
7575

7676
To install on NixOS:
7777

@@ -85,34 +85,54 @@ To install on a non NixOS:
8585
nix-env -iA nixpkgs.devbox
8686
```
8787

88-
or
88+
or
8989

9090
```bash
9191
nix profile install nixpkgs#devbox
9292
```
9393

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+
<TabItem value="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.
100+
101+
To get the latest version:
102+
103+
```bash
104+
nix profile install github:jetify-com/devbox/latest
105+
```
106+
107+
To install a specific version, you can run the following command (only supports versions 0.13.2 and above).
108+
109+
```bash
110+
nix profile install github:jetify-com/devbox/0.13.2
111+
```
112+
113+
94114
</TabItem>
95115
</Tabs>
96116

97117
## Updating Devbox
98118

99-
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`.
100120

101121
If you installed Devbox with Nix, you can update Devbox via Nix using `nix-env -u devbox`, or `nix profile upgrade`.
102122

103123
You can find release notes and details on the [Releases page](https://github.com/jetify-com/devbox/releases) of the Devbox Github repo.
104124

105125
## Rolling Back or Pinning a Specific Version of Devbox
106126

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:
108128

109129
```bash
110130
export DEVBOX_USE_VERSION=0.8.0
111131
```
112132

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.
114134

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).
116136

117137
## Next Steps
118138

0 commit comments

Comments
 (0)