Nix Recipe: Setup Postgresql

This is a nix recipe for building and running postgresql-12 in a virtual nix environment. Create your project folder and save the following file as shell.nix let nixpkgs = import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz) { overlays = []; config = {}; }; in with nixpkgs; stdenv.mkDerivation { name = "postgres-env"; buildInputs = []; nativeBuildInputs = [ zsh vim geos gdal nixpkgs-fmt # postgres-12 with postgis support (postgresql_12.withPackages (p: [ p.postgis ])) ]; postgresConf = writeText "postgresql....

March 2, 2020 · 2 min · wilspi