From 53f64b52763c5275f6810ebc3d2735a656071486 Mon Sep 17 00:00:00 2001 From: Luna Nightshade Date: Wed, 21 Jun 2023 21:45:16 +0200 Subject: [PATCH] BAYSHORE_NIX --- flake.nix | 5 ++++- src/index.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 04d517e..c9acaf2 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ in rec { packages.bayshore = pkgs.buildNpmPackage { pname = "bayshore"; - version = "1.0.0"; + version = "1.0.1"; src = ./.; npmDepsHash = "sha256-7iVoTJv5rvdiUWyhrDOGEboOo1sdQ7YvZOqbgvz/mF8="; @@ -111,6 +111,8 @@ preStart = '' export DATABASE_URL="${cfg.postgresUrl}" + export POSTGRES_URL="${cfg.postgresUrl}" + export BAYSHORE_NIX="true" ${pkg}/bin/prisma migrate deploy --schema=${pkg}/prisma/schema.prisma ''; @@ -122,6 +124,7 @@ export DATABASE_URL="${cfg.postgresUrl}" export POSTGRES_URL="${cfg.postgresUrl}" export BAYSHORE_CONFIG_PATH="${cfg.configFile}" + export BAYSHORE_NIX="true" # The ports will always be on default # because they're set through env-vars here. diff --git a/src/index.ts b/src/index.ts index 040e03d..7bccb26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,11 @@ import process from 'process'; import * as dotenv from "dotenv"; -dotenv.config({path: __dirname + '/.env'}); + +if (!process.env.BAYSHORE_NIX) +{ + dotenv.config({path: __dirname + '/.env'}); +} let tracing: any = {};