Skip to content

Commit c2ab2ca

Browse files
authored
Update PostgreSQL example for cross-platform (#1763)
## Summary Current PostgreSQL example doesn't work on MacOS because it attempts to install glibcLocales. This updates the example and documentation to only install glibcLocales on Linux ## How was it tested? CI/CD, run example locally --------- Signed-off-by: John Lago <[email protected]>
1 parent dd0d522 commit c2ab2ca

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

docs/app/docs/devbox_examples/databases/postgres.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ PostgreSQL can be automatically configured by Devbox via the built-in Postgres P
99

1010
## Adding Postgres to your Shell
1111

12-
`devbox add postgresql glibcLocales`, or in your `devbox.json`, add
12+
You can install the PostgreSQL server and client by running`devbox add postgresql`. In some Linux distributions, you may also need to add `glibcLocales`, which can be added using `devbox add glibcLocales --platform=x86_64-linux,aarch64-linux`.
13+
14+
Alternatively, you can add the following to your devbox.json:
1315

1416
```json
15-
"packages": [
16-
"postgresql@latest",
17-
"glibcLocales@latest"
18-
]
17+
"packages": {
18+
"postgresql": "latest",
19+
"glibcLocales": {
20+
"version": "latest",
21+
"platforms": ["x86_64-linux", "aarch64-linux"]
22+
}
23+
}
1924
```
2025

2126
This will install the latest version of Postgres. You can find other installable versions of Postgres by running `devbox search postgresql`. You can also view the available versions on [Nixhub](https://www.nixhub.io/packages/postgresql)
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
2-
"packages": [
3-
"postgresql@latest"
4-
],
2+
"packages": {
3+
"postgresql": "latest",
4+
"glibcLocales": {
5+
"version": "latest",
6+
"platforms": ["x86_64-linux", "aarch64-linux"]
7+
}
8+
},
59
"shell": {
610
"init_hook": null
711
}
8-
}
12+
}
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4+
"glibcLocales@latest": {
5+
"last_modified": "2024-01-14T03:55:27Z",
6+
"resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#glibcLocales",
7+
"source": "devbox-search",
8+
"version": "2.38-27",
9+
"systems": {
10+
"aarch64-linux": {
11+
"store_path": "/nix/store/i0aff1lm1js9j9ggw7js7n5869bfxm6z-glibc-locales-2.38-27"
12+
},
13+
"x86_64-linux": {
14+
"store_path": "/nix/store/wyl74hap7bh513hp3rz1j608gs7267af-glibc-locales-2.38-27"
15+
}
16+
}
17+
},
418
"postgresql@latest": {
519
"last_modified": "2023-05-01T16:53:22Z",
20+
"plugin_version": "0.0.2",
621
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#postgresql",
722
"version": "14.7"
823
}
924
}
10-
}
25+
}

0 commit comments

Comments
 (0)