This commit is contained in:
hakutaku
2025-09-23 19:15:07 +03:00
parent d58211507d
commit 65859bd87f
15 changed files with 214 additions and 171 deletions

View File

@@ -1,6 +1,5 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.05";
postgresDirectory = ".data/postgres";
pkgs = import nixpkgs {
config = { };
@@ -23,8 +22,6 @@ let
);
in
[
pkgs.postgresql_16
pkgs.rabbitmq-server
pkgs.nixfmt-rfc-style
pkgs.gnumake
phpForRuntimeWithXDebug
@@ -35,26 +32,4 @@ let
in
pkgs.mkShell {
inherit packages;
shellHook = ''
export COMPOSER_CACHE_DIR=$(pwd)/var/cache/composer
export RABBITMQ_CONFIG_FILE=$(pwd)/.dev/rabbitmq.conf
export RABBITMQ_MNESIA_BASE=$(pwd)/.data/rabbitmq
export RABBITMQ_LOGS=$(pwd)/var/log/rabbitmq.log
mkdir -p $(pwd)/var/cache/composer
if [ ! -d $(pwd)/var/log ]; then
mkdir -p $(pwd)/var/log
fi
# https://yannesposito.com/posts/0024-replace-docker-compose-with-nix-shell/index.html
if [ ! -d ${postgresDirectory} ]; then
mkdir -p ${postgresDirectory}
initdb -D ${postgresDirectory}
pg_ctl -D ${postgresDirectory} -l $(pwd)/var/log/postgres.log -o "--unix_socket_directories='$PWD'" start
createdb app
pg_ctl -D ${postgresDirectory} stop
fi
'';
}