Add MySql environment

This commit is contained in:
coolneng 2020-05-26 19:42:16 +02:00
parent 02e292720f
commit 5198dc5016
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 21 additions and 0 deletions

21
env/mysql.nix vendored Normal file
View File

@ -0,0 +1,21 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell {
buildInputs = [ mysql57 ];
shellHook = ''
pkill mysql
rm -rf .mysql && mkdir .mysql
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --initialize-insecure
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --skip-networking &
sleep 1
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/assets/db.sql
alias phpunit="./vendor/bin/phpunit"
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
'';
}