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
## Summary
Update docs and examples for Devbox 0.10.0
## How was it tested?
Localhost + Vercel. Also ran lint
---------
Signed-off-by: John Lago <[email protected]>
Co-authored-by: Lucille Hua <[email protected]>
Copy file name to clipboardExpand all lines: docs/app/docs/cli_reference/devbox_services_up.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ 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
-
|`--process-compose-file string`| path to process compose file or directory containing process compose-file.yaml|yml. Default is directory containing devbox.json |
34
+
|`--process-compose-file string`| path to process compose file or directory containing process compose-file.yaml\|yml. Default is directory containing devbox.json |
Copy file name to clipboardExpand all lines: docs/app/docs/configuration.md
+9-15Lines changed: 9 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,7 @@ Your devbox configuration is stored in a `devbox.json` file, located in your pro
13
13
"init_hook": "...",
14
14
"scripts": {}
15
15
},
16
-
"include": [],
17
-
"nixpkgs": {
18
-
"commit": "..."
19
-
}
16
+
"include": []
20
17
}
21
18
```
22
19
@@ -230,26 +227,23 @@ To run multiple commands in a single script, you can pass them as an array:
230
227
231
228
### Include
232
229
233
-
Includes can be used to explicitly add extra configuration or plugins to your Devbox project. Currently this only supports adding our [built-in plugins](guides/plugins.md) to your project.
234
-
235
-
You should use this section to activate plugins when you install a package from a [Flake](guides/using_flakes.md) that uses a plugin. To ensure that a plugin is activated for your project, add it to the `include` section of your `devbox.json`. For example, to explicitly activate the PHP plugin, you can add the following to your `devbox.json`:
230
+
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.
236
231
232
+
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.
237
233
```json
238
234
{
239
235
"include": [
236
+
// Include a plugin from a Github Repo. The repo must have a plugin.json in it's root,
237
+
// or in the directory specified by ?dir
238
+
"github:org/repo/ref?dir=<path-to-plugin>"
239
+
// Include a local plugin. The path must point to a plugin.json
240
+
"path:path/to/plugin.json"
241
+
// Force activate a builtin plugin
240
242
"plugin:php-config"
241
243
]
242
244
}
243
245
```
244
246
245
-
### Nixpkgs
246
-
247
-
The Nixpkg object is used to optionally configure which version of the Nixpkgs repository you want Devbox to use as the default for installing packages. It currently takes a single field, `commit`, which takes a commit hash for the specific revision of Nixpkgs you want to use.
248
-
249
-
If a Nixpkg commit is not set, Devbox will automatically add a default commit hash to your `devbox.json`. To upgrade your packages to the latest available versions in the future, you can replace the default hash with the latest nixpkgs-unstable hash from https://status.nixos.org.
250
-
251
-
To learn more, consult our guide on [setting the Nixpkg commit hash](guides/pinning_packages.md).
252
-
253
247
### Example: A Rust Devbox
254
248
255
249
An example of a devbox configuration for a Rust project called `hello_world` might look like the following:
Copy file name to clipboardExpand all lines: docs/app/docs/devbox_examples/languages/nodejs.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ Most NodeJS Projects will install their dependencies locally using NPM or Yarn,
8
8
9
9
[](https://devbox.sh/open/templates/node-npm)
10
10
11
-
12
11
## Adding NodeJS to your Shell
13
12
14
13
`devbox add nodejs`, or in your `devbox.json`:
14
+
15
15
```json
16
16
"packages": [
17
17
"nodejs@18"
@@ -20,20 +20,35 @@ Most NodeJS Projects will install their dependencies locally using NPM or Yarn,
20
20
21
21
This will install NodeJS 18, and comes bundled with `npm`. You can find other installable versions of NodeJS by running `devbox search nodejs`. You can also view the available versions on [Nixhub](https://www.nixhub.io/packages/nodejs)
22
22
23
-
## Adding Yarnas your Package Manager
23
+
## Adding Yarn, NPM, or pnpm as your Node Package Manager
We recommend using [Corepack](https://github.com/nodejs/corepack/) to install and manage your Node Package Manager in Devbox. Corepack comes bundled with all recent Nodejs versions, and you can tell Devbox to automatically configure Corepack using a built-in plugin. When enabled, corepack binaries will be installed in your project's `.devbox` directory, and automatically added to your path.
26
26
27
-
[](https://devbox.sh/open/templates/node-yarn)
27
+
To enable Corepack, set `DEVBOX_COREPACK_ENABLED` to `true` in your `devbox.json`:
28
28
29
-
`devbox add yarn`, or in your `devbox.json` add:
30
29
```json
31
-
"packages": [
32
-
"nodejs@18",
33
-
"yarn@latest"
34
-
],
30
+
{
31
+
"packages": ["nodejs@18"],
32
+
"env": {
33
+
"DEVBOX_COREPACK_ENABLED": "true"
34
+
}
35
+
}
35
36
```
36
37
38
+
To disable Corepack, remove the `DEVBOX_COREPACK_ENABLED` variable from your devbox.json
Copy file name to clipboardExpand all lines: docs/app/docs/faq.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,33 @@ 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 [Flake References](./guides/using_flakes.md).
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
-
You can learn more about non-default outputs [here](./guides/using_flakes.md#installing-additional-outputs-from-a-flake).
36
+
For example, the command below will install both the default output `out`, and the `cli` output for the prometheus package:
37
+
38
+
```bash
39
+
devbox add prometheus --outputs=out,cli
40
+
```
41
+
42
+
You can also specify non-default outputs in [flake references](./guides/using_flakes.md):
## I'm trying to build a project, but it says that I'm missing `libstdc++`. How do I install this library in my project?
39
49
40
50
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`.
41
51
52
+
## 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
53
+
54
+
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.
55
+
56
+
There are three ways to work around this issue:
57
+
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`.
58
+
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`
59
+
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.**
60
+
42
61
## How can I use custom Nix packages or overrides with Devbox?
43
62
44
63
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.
0 commit comments