Nix: add production flag to package

This commit is contained in:
Toast 2025-02-03 12:48:24 +01:00
parent 094c7388de
commit 0b3de6803e
2 changed files with 3 additions and 2 deletions

View file

@ -15,6 +15,7 @@
packages = rec { packages = rec {
default = shows-api; default = shows-api;
shows-api = pkgs.callPackage ./package.nix { }; shows-api = pkgs.callPackage ./package.nix { };
shows-api-dev = pkgs.callPackage ./package.nix { production = false; };
}; };
} }
); );

View file

@ -1,7 +1,7 @@
{ lib { lib
, buildNpmPackage , buildNpmPackage
, nodejs , nodejs
, , production ? true
}: }:
buildNpmPackage { buildNpmPackage {
name = "shows-api"; name = "shows-api";
@ -22,7 +22,7 @@ buildNpmPackage {
makeWrapper ${lib.getExe nodejs} $out/bin/shows-api \ makeWrapper ${lib.getExe nodejs} $out/bin/shows-api \
--add-flags $out/dist/main --chdir $out \ --add-flags $out/dist/main --chdir $out \
--set NODE_ENV production --set NODE_ENV ${if production then "production" else "development"}
''; '';
meta = { meta = {