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
Copy file name to clipboardExpand all lines: docs/app/docs/devbox_global.md
+24-19Lines changed: 24 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
2
title: Use Devbox as your Primary Package Manager
3
+
description: Install packages and tools system wide with Devbox Global
3
4
---
4
5
5
6
In addition to managing isolated development environments, you can use Devbox as a general package manager. Devbox Global allows you to add packages to a global `devbox.json.` This is useful for installing a standard set of tools you want to use across multiple Devbox Projects.
@@ -17,6 +18,7 @@ You can also use `devbox global` to replace package managers like `brew` and `ap
17
18
18
19
Devbox saves your global config in a `devbox.json` file in your home directory. This file can be shared with other users or checked into source control to synchronize it across machines.
19
20
21
+
20
22
## Adding and Managing Global Packages
21
23
22
24
You can install a package using `devbox global add [<package>]`, where the package names should be a list of [Nix Packages](https://search.nixos.org/packages) you want to install.
@@ -54,16 +56,29 @@ devbox global remove ripgrep
54
56
ripgrep was removed
55
57
```
56
58
59
+
## Using Fleek with Devbox Global
60
+
61
+
[Fleek](https://getfleek.dev/) provides a nicely tuned set of packages and configuration for common tools that is compatible with Devbox Global. Configurations are provided at different [levels of bling](https://getfleek.dev/docs/bling), with higher levels adding more packages and opinionated configuration.
62
+
63
+
To install a Fleek profile, you can use `devbox global pull <fleek-url>`, where the Fleek URL indicates the profile you want to install. For example, to install the `high` bling profile, you can run:
64
+
65
+
```bash
66
+
devbox global pull https://devbox.getfleek.dev/high
67
+
```
68
+
69
+
Fleek profiles also provide a few convenience scripts to automate setting up your profile. You can view the full list of scripts using `devbox global run` with no arguments
70
+
71
+
For more information, see the [Fleek for Devbox Docs](https://getfleek.dev/docs/devbox)
72
+
57
73
## Using Global Packages in your Host Shell
58
74
59
75
If you want to make your global packages available in your host shell, you can add them to your shell PATH. Running `devbox global shellenv` will print the command necessary to source the packages.
60
76
61
-
62
77
### Add Global Packages to your current Host Shell
63
78
To temporarily add the global packages to your current shell, run:
64
79
65
80
```bash
66
-
.<(devbox global shellenv)
81
+
.<(devbox global shellenv --init-hook)
67
82
```
68
83
69
84
You can also add a hook to your shell's config to make them available whenever you launch your shell:
@@ -73,7 +88,7 @@ You can also add a hook to your shell's config to make them available whenever y
73
88
Add the following command to your `~/.bashrc` file:
74
89
75
90
```bash
76
-
eval"$(devbox global shellenv)"
91
+
eval"$(devbox global shellenv --init-hook)"
77
92
```
78
93
79
94
Make sure to add this hook before any other hooks that use your global packages.
@@ -82,33 +97,22 @@ Make sure to add this hook before any other hooks that use your global packages.
82
97
Add the following command to your `~/.zshrc` file:
83
98
84
99
```bash
85
-
eval"$(devbox global shellenv)"
100
+
eval"$(devbox global shellenv --init-hook)"
86
101
```
87
102
88
103
### Fish
89
104
90
105
Add the following command to your `~/.config/fish/config.fish` file:
91
106
92
107
```bash
93
-
devbox global shellenv |source
108
+
devbox global shellenv --init-hook |source
94
109
```
95
110
111
+
## Sharing Your Global Config with Git
96
112
97
-
## Sharing Your Global Config
98
-
99
-
Your global `devbox.json` will be stored in `$XDG_DATA_HOME/devbox/global/default/devbox.json`. If `$XDG_DATA_HOME` is not set, it will default to `~/.local/share/devbox/global/default/devbox.json`.
100
-
101
-
If you want to share your configuration with across machines or with other users, you can copy this file to a git repository or host it online. You can then download and set the config as your global profile using `devbox global pull <path> | <url>`.
102
-
103
-
```bash
104
-
# Load the global config from a file
105
-
106
-
devbox global pull /path/to/devbox.json
113
+
You can use Git to synchronize your `devbox global` config across multiple machines using `devbox global push <remote>` and `devbox global pull <remote>`.
107
114
108
-
# Load the global config from a github repo
109
-
110
-
devbox global pull https://raw.githubusercontent.com/org/repo/branch/path/to/devbox.json
111
-
```
115
+
Your global `devbox.json` and any other files in the Git remote will be stored in `$XDG_DATA_HOME/devbox/global/default`. If `$XDG_DATA_HOME` is not set, it will default to `~/.local/share/devbox/global/default`. You can view the current global directory by running `devbox global path`.
112
116
113
117
## Next Steps
114
118
@@ -118,6 +122,7 @@ devbox global pull https://raw.githubusercontent.com/org/repo/branch/path/to/dev
118
122
***[Devbox Scripts](guides/scripts.md):** Automate setup steps and configuration for your shell using Devbox Scripts.
119
123
***[Configuration Guide](configuration.md):** Learn how to configure your shell and dev environment with `devbox.json`.
120
124
***[Browse Examples](https://github.com/jetpack-io/devbox-examples):** You can see how to create a development environment for your favorite tools or languages by browsing the Devbox Examples repo.
125
+
***[Using Flakes with Devbox](guides/using_flakes.md):** Learn how to install packages from Nix Flakes.
0 commit comments