From 3e236fb983e5cd8b70a9dbe01ce3ae1d23a7f891 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:20:37 -0800 Subject: [PATCH 1/2] Update PostgreSQL example for cross-platform --- .../docs/devbox_examples/databases/postgres.md | 15 ++++++++++----- examples/databases/postgres/devbox.json | 12 ++++++++---- examples/databases/postgres/devbox.lock | 17 ++++++++++++++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/docs/app/docs/devbox_examples/databases/postgres.md b/docs/app/docs/devbox_examples/databases/postgres.md index 0e076bb7803..8524b45f3e6 100644 --- a/docs/app/docs/devbox_examples/databases/postgres.md +++ b/docs/app/docs/devbox_examples/databases/postgres.md @@ -9,13 +9,18 @@ PostgreSQL can be automatically configured by Devbox via the built-in Postgres P ## Adding Postgres to your Shell -`devbox add postgresql glibcLocales`, or in your `devbox.json`, add +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 -p x86_64-linux,aarch64-linux`. + +Alternatively, you can add the following to your devbox.json: ```json - "packages": [ - "postgresql@latest", - "glibcLocales@latest" - ] + "packages": { + "postgresql": "latest", + "glibcLocales": { + "version": "latest", + "platforms": ["x86_64-linux", "aarch64-linux"] + } + } ``` 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) diff --git a/examples/databases/postgres/devbox.json b/examples/databases/postgres/devbox.json index 6d56c845a3f..e528a436349 100644 --- a/examples/databases/postgres/devbox.json +++ b/examples/databases/postgres/devbox.json @@ -1,8 +1,12 @@ { - "packages": [ - "postgresql@latest" - ], + "packages": { + "postgresql": "latest", + "glibcLocales": { + "version": "latest", + "platforms": ["x86_64-linux", "aarch64-linux"] + } + }, "shell": { "init_hook": null } -} \ No newline at end of file +} diff --git a/examples/databases/postgres/devbox.lock b/examples/databases/postgres/devbox.lock index f44c29f2510..be3518ee4d0 100644 --- a/examples/databases/postgres/devbox.lock +++ b/examples/databases/postgres/devbox.lock @@ -1,10 +1,25 @@ { "lockfile_version": "1", "packages": { + "glibcLocales@latest": { + "last_modified": "2024-01-14T03:55:27Z", + "resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#glibcLocales", + "source": "devbox-search", + "version": "2.38-27", + "systems": { + "aarch64-linux": { + "store_path": "/nix/store/i0aff1lm1js9j9ggw7js7n5869bfxm6z-glibc-locales-2.38-27" + }, + "x86_64-linux": { + "store_path": "/nix/store/wyl74hap7bh513hp3rz1j608gs7267af-glibc-locales-2.38-27" + } + } + }, "postgresql@latest": { "last_modified": "2023-05-01T16:53:22Z", + "plugin_version": "0.0.2", "resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#postgresql", "version": "14.7" } } -} \ No newline at end of file +} From 6536605d1cb069b0f2a1d8b68e5f4b39a4ee2b58 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:23:23 -0800 Subject: [PATCH 2/2] Update postgres.md Signed-off-by: John Lago <750845+Lagoja@users.noreply.github.com> --- docs/app/docs/devbox_examples/databases/postgres.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/app/docs/devbox_examples/databases/postgres.md b/docs/app/docs/devbox_examples/databases/postgres.md index 8524b45f3e6..31e29192487 100644 --- a/docs/app/docs/devbox_examples/databases/postgres.md +++ b/docs/app/docs/devbox_examples/databases/postgres.md @@ -9,7 +9,7 @@ PostgreSQL can be automatically configured by Devbox via the built-in Postgres P ## Adding Postgres to your Shell -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 -p x86_64-linux,aarch64-linux`. +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`. Alternatively, you can add the following to your devbox.json: