diff --git a/db/init.sh b/db/init.sh index 2c0660f2..10dde1cf 100755 --- a/db/init.sh +++ b/db/init.sh @@ -6,6 +6,7 @@ DB_INIT_DIR=${1:-docker-entrypoint-initdb.d} echo "****************" echo "****************" echo "Running db init!" +echo "Using base directory: $DB_INIT_DIR" echo "****************" echo "****************" diff --git a/flake.nix b/flake.nix index 7083e044..1b1004ff 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,10 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; - systems.url = "github:nix-systems/default"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + inputs.flake-utils { + src = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + } }; outputs = { self, nixpkgs, systems, ... } @ inputs: @@ -21,7 +24,6 @@ buildPhase = '' yarn build ''; - distPhase = ""; installPhase = '' mkdir -p $out/libexec/bobaserver mv node_modules $out/libexec/bobaserver/ @@ -30,9 +32,10 @@ }; bobadatabase = pkgs.writeShellScriptBin "bobadatabase" '' - /bin/sh -c "${bobaserver-assets}/libexec/bobaserver/deps/bobaserver/db/init.sh ${bobaserver-assets}/libexec/bobaserver/deps/bobaserver/db/" + ${bobaserver-assets}/libexec/bobaserver/deps/bobaserver/db/init.sh ${bobaserver-assets}/libexec/bobaserver/deps/bobaserver/db/ ''; + # TODO: swap with wrapProgram bobaserver = pkgs.writeShellScriptBin "bobaserver" '' export NODE_PATH=${bobaserver-assets}/libexec/bobaserver/node_modules export DEBUG=bobaserver:*,-*info @@ -42,6 +45,5 @@ default = bobaserver; } ); - defaultPackage = forEachSystem (system: self.packages.${system}.default); }; } \ No newline at end of file diff --git a/server/index.ts b/server/index.ts index c8e0b564..55f48b5c 100644 --- a/server/index.ts +++ b/server/index.ts @@ -48,7 +48,7 @@ app.use((req, res, next) => { initOpenApiDocs(app); app.use(withLoggedIn); -const port = process.env.BOBASERVER_PORT || 4200; +const port = parseInt(process.env.BOBASERVER_PORT || "4200"); applyRoutes(app); registerEventHandlers();