Created
December 9, 2025 10:22
-
-
Save mirrrjr/acb58694b64e1c13823899d756917f49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "Laravel + React + MySQL professional dev environment"; | |
| inputs = { | |
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | |
| flake-utils.url = "github:numtide/flake-utils"; | |
| }; | |
| outputs = { self, nixpkgs, flake-utils }: | |
| flake-utils.simpleFlake { inherit self nixpkgs; } (system: | |
| let | |
| pkgs = import nixpkgs { inherit system; }; | |
| in { | |
| devShell = pkgs.mkShell { | |
| name = "miniapp-dev-env"; | |
| buildInputs = [ | |
| # PHP stack | |
| pkgs.php82 | |
| pkgs.php82Extensions.curl | |
| pkgs.php82Extensions.mbstring | |
| pkgs.php82Extensions.intl | |
| pkgs.php82Extensions.pdo_mysql | |
| pkgs.php82Extensions.openssl | |
| pkgs.composer | |
| # Node.js stack | |
| pkgs.nodejs_20 | |
| pkgs.pnpm | |
| pkgs.yarn | |
| # Databases | |
| pkgs.mysql80 | |
| pkgs.redis | |
| # Utilities | |
| pkgs.git | |
| pkgs.openssl | |
| ]; | |
| # Environment ichida MySQL avtomatik ishga tushadi | |
| shellHook = '' | |
| echo "π Laravel + React dev environment loaded!" | |
| echo "π¦ Node $(node -v), PHP $(php -v | head -n 1)" | |
| # MySQL data dir | |
| export MYSQL_DATA_DIR="$PWD/.mysql-data" | |
| export MYSQL_UNIX_PORT="$PWD/mysql.sock" | |
| export MYSQL_TCP_PORT=3306 | |
| if [ ! -d "$MYSQL_DATA_DIR" ]; then | |
| echo "βοΈ MySQL datadir yaratilyapti..." | |
| mysqld --initialize-insecure --datadir="$MYSQL_DATA_DIR" | |
| fi | |
| # MySQL serverni fon rejimida ishga tushirish | |
| echo "π’ MySQL server ishga tushyapti..." | |
| mysqld --datadir="$MYSQL_DATA_DIR" \ | |
| --socket="$MYSQL_UNIX_PORT" \ | |
| --port="$MYSQL_TCP_PORT" \ | |
| --skip-networking=0 \ | |
| --bind-address=127.0.0.1 & | |
| # Redis | |
| echo "π Redis ishga tushyapti..." | |
| redis-server --daemonize yes | |
| echo "All OK!" | |
| ''; | |
| }; | |
| }); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment