Add accentor nix shell configs

This commit is contained in:
Charlotte Van Petegem 2020-02-22 11:29:31 +01:00
parent c47b99a8c1
commit e3abd332af
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,29 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = [
pkgs.ffmpeg
pkgs.postgresql
pkgs.ruby_2_7
pkgs.taglib
pkgs.zlib
];
shellHook = ''
export PGDATA=$PWD/tmp/postgres_data
export PGHOST=$PWD/tmp/postgres
export PGDATABASE=postgres
export DATABASE_URL="postgresql:///postgres?host=$PGHOST"
if [ ! -d $PGHOST ]; then
mkdir -p $PGHOST
fi
if [ ! -d $PGDATA ]; then
echo 'Initializing postgresql database...'
initdb $PGDATA --auth=trust >/dev/null
fi
cat >"$PGDATA/postgresql.conf" <<HERE
listen_addresses = '''
unix_socket_directories = '$PGHOST'
HERE
'';
}

View file

@ -0,0 +1,9 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = [
pkgs.nodejs-12_x
pkgs.yarn
];
}