You don't really seem to have a 'contributing' cha...
# help
i
You don't really seem to have a 'contributing' channel so I will post here; I'm interested in packaging the Supabase server and client as a Nix package and NixOS module (https://nixos.org/); I can understand that as a SaaSy sort of outfit, self-hosting isn't priority #1, but I saw you also offer support contracts and I think this would make supabase appealing for some specific on-premise deployment scenarios that certain industries face. Anyway, I'm not super well versed in Nix stuff, but I am also no total beginner; I'm planning to leverage the Nix community to get some guidance and help on how to do this. What I would like is a little guidance from the supabase team - in particular the infra folks - in understand the deployment patterns. I already found the [self-hosting guide](https://supabase.com/docs/guides/hosting/overview) including the [docker section](https://supabase.com/docs/guides/hosting/docker) and the [docker-compose file](https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml). My questions for now: 1. Would someone from the supabase infra team be willing to advise me throughout this process? 2. Is it so that everything in the deployment can be configured through environment variables (as it seems when looking at the docker-compose file)? 3. I noticed that the new Deno-based functions feature isn't yet in the docker-compose file? I the infra for functions running a little behind still?
n
Hello @ixxie! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
🆕 Contributing Nix-based Deployment of Supabase
o
Hi @ixxie Thanks you for your interest. Pinging @User to notify them about it, so you can discuss with them about it. tltr: Ixxie would like to package supabase selfhost under NixOS and ask about the workflow
n
Contributing Nix-based Deployment of Supabase
s
Hey @ixxie. More Nix sounds great! We actually use Nix(plus NixOps) for some of our benchmarks: PostgreSQL: https://github.com/supabase/benchmarks/tree/master/postgresql PostgREST: https://github.com/supabase/benchmarks/tree/master/postgrest > 1. Would someone from the supabase infra team be willing to advise me throughout this process? What I would do is to package all the components first and then do NixOS modules for them.
For example, in the PostgREST benchmark, I used Nginx instead of Kong because Kong is not available on nixpkgs. So you'd need to package Kong - think this would be welcomed on nixpkgs. Then build/package Realtime, which is Elixir based - at the time I tried to package it there wasn't good support for building Elixir packages in Nix but I've noticed this is not the case anymore. Gotrue, storage and pg-meta might be the easier ones to package since JS/Golang building support is good in Nix IIRC. These might not fit in nixpkgs.. so perhaps you can have them in your repo with a Nix Flake.
> 2. Is it so that everything in the deployment can be configured through environment variables (as it seems when looking at the docker-compose file)? Yes, that sounds good. In the postgREST benchmark I configure the deployment through env vars, Nix plays nicely with that. https://github.com/supabase/benchmarks/blob/master/postgrest/deploy.nix#L4-L12
> 3. I noticed that the new Deno-based functions feature isn't yet in the docker-compose file? I the infra for functions running a little behind still? Yeah, Deno functions are brand new so the CLI is lagging behind a bit. Btw, Deno is already available on Nixpkgs. https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/web/deno/default.nix
Hope that's helpful. Let me know if you have more questions!
i
Thanks @Steve, that is helpful indeed and I am happy there is someone in the team with knowledge and interest in the Nix ecosystem.
Seems there would be no problem adding everything to Nixpkgs!
s
@ixxie Awesome 🎉 . Keep me posted!