diff --git a/.envrc b/.envrc deleted file mode 100644 index 440612f2..00000000 --- a/.envrc +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Automatically sets up your devbox environment whenever you cd into this -# directory via our direnv integration: - -eval "$(devbox generate direnv --print-envrc)" - -# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ -# for more details - -export APP_ENV="${APP_ENV:-development}" -export DB_USER="${DB_USER:-postgres}" -export DB_PASS="${DB_PASS:-pass}" -export DB_HOST="${DB_HOST:-localhost}" -export DB_PORT="${DB_PORT:-5432}" -export DB_NAME="${DB_NAME:-query_orchestration}" -export DB_URI="${DB_URI:-"postgres://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"}" - -dotenv_if_exists .env - -env_vars_required APP_ENV -env_vars_required QUEUE_URL -env_vars_required DB_USER DB_PASS DB_HOST DB_PORT DB_NAME - -ALLOWED_ENVS=("development","production") - -if [[ ! $ALLOWED_ENVS[@] =~ $APP_ENV ]]; then - echo APP_ENV invalid - exit 1 -fi \ No newline at end of file diff --git a/devbox.json b/devbox.json index f9311b16..964b334f 100644 --- a/devbox.json +++ b/devbox.json @@ -5,7 +5,6 @@ "protolint@0.50.5", "yamllint@1.35.1", "sqlc@1.27.0", - "direnv@2.35.0", "go-mockery@2.46.3", "protoc-gen-go@1.35.1", "protoc-gen-go-grpc@1.3.0", @@ -19,7 +18,7 @@ ], "shell": { "init_hook": [ - "eval \"$(direnv hook bash)\"", + "DB_URI=postgres://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable", "echo 'Welcome to the DoczyAI devbox!'" ], "scripts": { @@ -27,5 +26,14 @@ "task deps:download" ] } - } + }, + "env": { + "APP_ENV": "development", + "DB_USER": "postgres", + "DB_PASS": "pass", + "DB_HOST": "localhost", + "DB_PORT": "5432", + "DB_NAME": "query_orchestration" + }, + "env_from": ".env" } diff --git a/devbox.lock b/devbox.lock index fc328dca..c6b9737d 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,54 +1,6 @@ { "lockfile_version": "1", "packages": { - "direnv@2.35.0": { - "last_modified": "2024-12-23T21:10:33Z", - "resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#direnv", - "source": "devbox-search", - "version": "2.35.0", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/xp28bzq6qi11db7pqgfx3rc139q45489-direnv-2.35.0", - "default": true - } - ], - "store_path": "/nix/store/xp28bzq6qi11db7pqgfx3rc139q45489-direnv-2.35.0" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/55vva1q4lhw2m62vvzzm2z26wfkpb430-direnv-2.35.0", - "default": true - } - ], - "store_path": "/nix/store/55vva1q4lhw2m62vvzzm2z26wfkpb430-direnv-2.35.0" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/gza242ir81wafi79cfxk619n36rxqqmk-direnv-2.35.0", - "default": true - } - ], - "store_path": "/nix/store/gza242ir81wafi79cfxk619n36rxqqmk-direnv-2.35.0" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/jw2ax71m8dzgs8xybginlsyw79ndyww1-direnv-2.35.0", - "default": true - } - ], - "store_path": "/nix/store/jw2ax71m8dzgs8xybginlsyw79ndyww1-direnv-2.35.0" - } - } - }, "go-migrate@4.18.1": { "last_modified": "2024-12-23T21:10:33Z", "resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#go-migrate",