Skip to content

Commit 258bab7

Browse files
committed
docs: update readme with nix cache info
1 parent 47d598f commit 258bab7

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,23 @@ We are building the features of Firebase using enterprise-grade, open source pro
111111
[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)
112112

113113

114-
## Experimental Nix Packaging of resources
114+
## Nix Packaging of resources
115115

116-
There is a `/nix` folder in this repo, plus a `flake.nix` and `flake.lock` that facilitate using the Nix package management system to package supabase/postgres, and all of our extensions and wrappers. A user will need nix installed on their machine. As of 4/1/2024 the package set only builds on target machines (`x86_64-linux` and `aarch64-linux`), however work is under way to also support building and using directly on `aarch64-darwin` (macOs). As of 4/1/2024, versions of packages and extensions are synced from `/ansible/vars.yml` via a utility that can be run by executing `nix run .#sync-exts-versions` (you must have nix installed and be on the supported `x86_64-linux` and `aarch64-linux` for this command to work). The short term goal is to sync these versions as they are updated by our infrastructure and postgres teams, then to see the nix packaged versions build successfully in parallel over time, along with tests of the nix packaged versions passing.
116+
There is a `/nix` folder in this repo, plus a `flake.nix` and `flake.lock` that facilitate using the Nix package management system to package supabase/postgres, and all of our extensions and wrappers. A user will need nix installed on their machine.
117117

118-
The supabase/postgres repo will continue to source it's dependencies from ansible for the short term, while we stabilize this nix build.
118+
The package set builds on target machines (`x86_64-linux` and `aarch64-linux`) with an accompanying nix cache, however work is under way to also support building and using directly on `aarch64-darwin` (macOs). Currently, `aarch64-daarwin` will build and run, but the cache is not yet automatically updated on each PR submission to this repo.
119119

120-
Forthcoming PR's will include: integrating the nix work into our ansible/packer builds, building natively on aarch64-darwin (macOs), more testing
120+
### Nix Binary Cache Configuration
121+
122+
To update our nix.conf to support the binary caches used by supabase:
123+
124+
1. open `/etc/nix/nix.cong`
125+
2. Add the following lines
126+
127+
```
128+
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
129+
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
130+
```
131+
3. save changes to the `/etc/nix/nix.conf` file
132+
4. On **linux**, run `sudo systemctl restart nix-daemon.service` on **macOS** run: `sudo launchctl stop org.nixos.nix-daemon` and `sudo launchctl start org.nixos.nix-daemon`
133+
5. verify by running nix config show | grep 'substituters\|trusted-public-keys'

0 commit comments

Comments
 (0)