2020-05-12 17:57:01 +02:00
|
|
|
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
mkShell {
|
2020-06-14 03:12:32 +02:00
|
|
|
buildInputs = [ php74 php74Extensions.pdo_mysql mysql57 ];
|
2020-05-12 17:57:01 +02:00
|
|
|
|
|
|
|
shellHook = ''
|
2020-05-18 15:42:14 +02:00
|
|
|
pkill mysql
|
2020-05-12 17:57:01 +02:00
|
|
|
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 &
|
2020-05-13 00:44:10 +02:00
|
|
|
sleep 1
|
2020-05-12 17:57:01 +02:00
|
|
|
|
|
|
|
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/database/db.sql
|
2020-06-14 03:12:32 +02:00
|
|
|
|
|
|
|
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
|
2020-06-18 15:59:21 +02:00
|
|
|
|
2020-06-21 19:36:38 +02:00
|
|
|
cd src
|
2020-06-18 15:59:21 +02:00
|
|
|
php -S localhost:8000
|
2020-05-12 17:57:01 +02:00
|
|
|
'';
|
|
|
|
}
|