23 lines
570 B
Nix
23 lines
570 B
Nix
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
with pkgs;
|
|
|
|
mkShell {
|
|
buildInputs = [ php74 php74Extensions.pdo_mysql 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)/database/db.sql
|
|
|
|
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
|
|
|
|
php -S localhost:8000
|
|
'';
|
|
}
|