{"id":15173123,"url":"https://github.com/supabase/nix-postgres","last_synced_at":"2025-10-01T10:31:20.627Z","repository":{"id":184285251,"uuid":"671604729","full_name":"supabase/nix-postgres","owner":"supabase","description":"Experimental port of supabase/postgres to Nix","archived":true,"fork":false,"pushed_at":"2024-04-29T13:19:33.000Z","size":230,"stargazers_count":51,"open_issues_count":10,"forks_count":7,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-01-19T19:56:48.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["supabase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-07-27T17:46:37.000Z","updated_at":"2025-01-10T08:13:36.000Z","dependencies_parsed_at":"2023-07-27T20:10:53.809Z","dependency_job_id":"55c970df-2b04-490a-aab1-9ce499224473","html_url":"https://github.com/supabase/nix-postgres","commit_stats":{"total_commits":140,"total_committers":8,"mean_commits":17.5,"dds":0.2857142857142857,"last_synced_commit":"0b39a8c2e2c9ea978f7d921cc03ea0d6c161ddb3"},"previous_names":["supabase/nix-postgres"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fnix-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fnix-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fnix-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fnix-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase","download_url":"https://codeload.github.com/supabase/nix-postgres/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234699958,"owners_count":18873468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-27T10:41:17.790Z","updated_at":"2025-10-01T10:31:20.297Z","avatar_url":"https://github.com/supabase.png","language":"Nix","funding_links":["https://github.com/sponsors/supabase"],"categories":[],"sub_categories":[],"readme":"# ARCHIVED: prototype nix package for supabase postgres\n\n\u003e ⚠️ 🚧 **NOTE** 🚧\n\u003e \n\u003e This repository is archived\n\u003e \n\u003e Development of this functionality has moved to [supabase/postgres](https://github.com/supabase/postgres/tree/develop/nix)\n\n--------------------\n\nThis repository contains **experimental code** to package PostgreSQL using\n**[Nix]**, and tooling and infrastructure for deploying it. Read the rest of\nthis README for some basic overview of the high level components.\n\nDon't know Nix? Want to understand some of the thinking here? To learn about Nix\nand some of the design constraints this repository are under, please see the\n[`docs/`](./docs/) directory which should help get you up to speed.\n\nIf you want to install Nix and play along quickly, check out the\n[Start Here](./docs/start-here.md) page.\n\n[Nix]: https://nixos.org\n\n## Fundamental components of this repository\n\nThis repository contains a few major high level components, which are outlined below.\n\n### PostgreSQL Binary Distributions\n\nThe following PostgreSQL releases are packaged up, along with extensions (read\nbelow) in order to create \"fully self contained\" binary distributions. In order to get ahold of them, you can use `nix build`:\n\n```\nnix build .#psql_14/bin -o result-14\nnix build .#psql_15/bin -o result-15\n```\n\nThis will create two symlinks named `result-14` (resp. `result-15`). You can use the resulting symlinks as a binary distribution; as if they were unpacked tarballs.\n\n### PostgreSQL Docker Images\n\nFrom the binary images generated by `nix build`, we also create Docker images. You can create\nand load an image like so:\n\n```\nnix build .#psql_15/docker -o result-15\ndocker load -i ./result-15\n```\n\nThere will then be an image named `postgresql-15:latest` tagged in local image\nregistry.\n\nThis repository also provides pre-packaged docker images hosted via GitHub Packages; simply download them with:\n\n```\ndocker pull ghcr.io/supabase/nix-postgres-14:latest\ndocker pull ghcr.io/supabase/nix-postgres-15:latest\n```\n\n### A full suite of extensions\n\nThe binary distributions have many extensions enabled; these include:\n\n- postgis\n- pgrouting\n- pgtap\n- pg_cron\n- pgaudit\n- pgjwt\n- plpgsql_check\n- pg_safeupdate\n- timescaledb\n- wal2json\n- plv8\n- rum\n- pgvector\n- pg_repack\n- pgroonga\n- pgsql\n- pg_plan_filter\n- pg_net\n- pg_hashids\n- pgsodium\n- pg_graphql\n- pg_stat_monitor\n- pg_jsonschema\n- vault\n- hypopg\n- pg_tle\n- wrappers\n- supautils\n- citus\n\nYou can just use `CREATE EXTENSION` to enable most of these. Some may require\ntweaks to [postgresql.conf.in](./tests/postgresql.conf.in) to enable.\n\n### Helpful development utilities\n\nWant to start a postgresql-15 server with a bunch of extensions? You don't even\nneed to download this repository; just use `nix run`:\n\n```\nnix run github:supabase/nix-postgres#start-server 15\n```\n\nThis will start PostgreSQL 15 on port `5435` on localhost with a temporary directory created by `mktemp -d`. Connect to it:\n\n```\naustin@GANON:~$ nix run github:supabase/nix-postgres#start-client 14\nStarting server for PSQL 14\npsql (14.8, server 15.3)\nWARNING: psql major version 14, server major version 15.\n         Some psql features might not work.\nType \"help\" for help.\n\npostgres=#\n```\n\nThe first argument of both commands simply specifies `14` or `15` to get the\nmajor version. This will be expanded in the future.\n\n### Migration testing tools\n\nYou can test database migrations (using some artificial data schemas);\nit uses the following data to set up the database:\n\n- [postgresql.conf.in](./tests/postgresql.conf.in)\n- [prime.sql](./tests/prime.sql)\n- [data.sql](./tests/migrations/data.sql)\n\nThen, run the following:\n\n```\nnix run github:supabase/nix-postgres#migration-test 14 15\n```\n\nThis will do a migration between versions 14 and 15, at the time of the latest commit to the `nix-postgres` repository.\n\nYou can also test arbitrary `/nix/store` paths; for example the following works:\n\n```\nnix run github:supabase/nix-postgres#migration-test \\\n  $(nix build github:supabase/nix-postgres#psql_14/bin --no-link --print-out-paths) \\\n  $(nix build github:supabase/nix-postgres#psql_15/bin --no-link --print-out-paths)\n```\n\nThus, you can arbitrarily mix and match various versions that might have been\nbuilt in CI, and test their upgrade paths.\n\nNote that the `data.sql` files and whatnot aren't complete; tweaks are very\nwelcome to cover as many edge cases as possible.\n\n### Nix binary cache\n\nThere is a nix binary cache located at the following URL:\n\n- https://nix-postgres-artifacts.s3.amazonaws.com/\n\nBinaries are signed with the public key:\n\n- `nix-cache.supabase.com-1:ZfEc7Qb7SN+qOTJGMtCz54rnVQ1W2ZI2ROCSSD6YQYc=`\n\n## Other notes\n\n- This repository should work \"in perpetuity\" (assuming Nix doesn't horribly\n  break years down the line), but will probably be migrated elsewhere if it's\n  successful, so don't get too cozy or familiar.\n- Austin uses **[jujutsu]** to develop this repository; but you don't have to\n  (you should try it, though!) The workflow used for this repo is \"linear\n  commits, no merges.\" If you submit PRs, they'll be rebased on top of the\n  existing history to match that. (YMMV but I prefer this style.)\n\n[jujutsu]: https://github.com/martinvonz/jj\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fnix-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase%2Fnix-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fnix-postgres/lists"}