2020-05-26 19:42:16 +02:00
|
|
|
{ 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
|
|
|
|
|
2020-06-23 20:28:43 +02:00
|
|
|
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/database/db.sql
|
2020-05-26 19:42:16 +02:00
|
|
|
|
|
|
|
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
|
|
|
|
'';
|
|
|
|
}
|