-
Notifications
You must be signed in to change notification settings - Fork 249
Docs for platform-specific packages #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
{ | ||
"packages": [ | ||
"yarn", | ||
"nodejs" | ||
], | ||
"shell": { | ||
"init_hook": null | ||
"packages": { | ||
"yarn": "latest", | ||
"nodejs": "latest" | ||
}, | ||
"shell": {}, | ||
"nixpkgs": { | ||
"commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"packages": { | ||
"nodejs": { | ||
"resolved": "github:NixOS/nixpkgs/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62#nodejs" | ||
"nodejs@latest": { | ||
"last_modified": "2023-08-30T00:25:28Z", | ||
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#nodejs_20", | ||
"source": "devbox-search", | ||
"version": "20.5.1" | ||
}, | ||
"yarn": { | ||
"resolved": "github:NixOS/nixpkgs/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62#yarn" | ||
"yarn@latest": { | ||
"last_modified": "2023-08-30T00:25:28Z", | ||
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#yarn", | ||
"source": "devbox-search", | ||
"version": "1.22.19" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,39 @@ For example, to use the latest version of `ripgrep,` run `devbox add ripgrep`, ` | |
|
||
Whenever you run `devbox update`, packages with the latest tag will be updated to the latest version available in our index. | ||
|
||
### Restricting Packages to Specific Platforms | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 I don't understand why this is in the "pinning packages" section. Isn't that about restricting to a certain version? Not totally sure this feature applies to this guide... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I was trying to find a guide to place it in, but not sure where the best place was. It seemed a little narrow for it's own page, but maybe that's the best place |
||
|
||
At times, you may need to install a package or library that is only available on a specific platform. For example, you may want to install a package that is only available on Linux, while still using the same Devbox configuration on your Mac. | ||
|
||
To avoid build or installation errors, you can tell Devbox to only install a package on specific platforms using the `--platforms` flag when you run `devbox add`. For example, to install the `busybox` package only on Linux systems, you can run: | ||
Lagoja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```bash | ||
devbox add busybox --platforms x86_64-linux,aarch64-linux | ||
Lagoja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
This will add ripgrep to your `devbox.json`, but will only install it when use devbox on a Linux machine. | ||
|
||
You can also tell Devbox to exclude a package from a specific platform using the `--exclude-platforms` flag. For example, to avoid installing `ripgrep` on an ARM-based Mac, you can run: | ||
Lagoja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
```bash | ||
devbox add ripgrep --exclude-platforms aarch64-darwin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. singular flag here too |
||
``` | ||
|
||
This will add ripgrep to your `devbox.json`, but will not install it when use devbox on an ARM-based Mac. | ||
|
||
Valid Platforms include: | ||
|
||
* `aarch64-darwin` | ||
* `aarch64-linux` | ||
* `x86_64-darwin` | ||
* `x86_64-linux` | ||
|
||
The platforms below are also supported, but will build packages from source | ||
|
||
* `i686-linux` | ||
* `armv7l-linux` | ||
|
||
## Manually Pinning a Nixpkg Commit for a Package | ||
|
||
If you want to use a specific Nixpkg revision for a package, you can use a `github:nixos/nixpkgs/<commit_sha>#<pkg>` Flake reference. The example below shows how to install the `hello` package from a specific Nixpkg commit: | ||
|
Uh oh!
There was an error while loading. Please reload this page.