Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running postgres on osx using nix package manager

Tags:

macos

nix

I'm using nix as a package manager on OSX. I've installed postgres. Now I'd like to start and stop the postgres server (and other related utilities). I can write a script to do this manually, and edit my config. But, is there a "best practice" way to do this on OSX? E.g. I found postgres configs under ~/.nix-profile/share, are there startup scrips for OSX somewhere?

like image 290
three-cups Avatar asked Nov 09 '22 13:11

three-cups


1 Answers

I've not come across anything related to the nix project for running services in the nixpkgs repo directly on OS X.

If you just have a few services you want to run I believe you'd have to put the scripts together yourself as you suggest.

Alternatively disnix should do what you're after but it might be a bit overkill just for one machine.

Another option would be to deploy a nixos configuration into a (optionally headless) virtualbox instance with nixops. I'm using this setup myself for a different use case, but it should certainly also support yours.

disnix, nixos and nixops are documented together with nix/nixpkgs on the nixos.org page.

like image 87
brocking Avatar answered Nov 15 '22 05:11

brocking