Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ejpcmac
Created September 28, 2018 12:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejpcmac/336799cfe3ed7f0a82cc674712e22166 to your computer and use it in GitHub Desktop.
Save ejpcmac/336799cfe3ed7f0a82cc674712e22166 to your computer and use it in GitHub Desktop.
Shell for Phoenix projects with node.js and PostgreSQL
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
elixir = beam.packages.erlangR21.elixir_1_7;
nodejs = nodejs-10_x;
postgresql = postgresql100;
in
mkShell {
buildInputs = [ elixir nodejs git postgresql ]
++ optional stdenv.isLinux inotify-tools # For file_system on Linux.
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
# For file_system on macOS.
CoreFoundation
CoreServices
]);
# Put the PostgreSQL databases in the project diretory.
shellHook = ''
export PGDATA="$PWD/db"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment