Nix: add production flag to package
This commit is contained in:
parent
094c7388de
commit
0b3de6803e
2 changed files with 3 additions and 2 deletions
|
|
@ -15,6 +15,7 @@
|
|||
packages = rec {
|
||||
default = shows-api;
|
||||
shows-api = pkgs.callPackage ./package.nix { };
|
||||
shows-api-dev = pkgs.callPackage ./package.nix { production = false; };
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, buildNpmPackage
|
||||
, nodejs
|
||||
,
|
||||
, production ? true
|
||||
}:
|
||||
buildNpmPackage {
|
||||
name = "shows-api";
|
||||
|
|
@ -22,7 +22,7 @@ buildNpmPackage {
|
|||
|
||||
makeWrapper ${lib.getExe nodejs} $out/bin/shows-api \
|
||||
--add-flags $out/dist/main --chdir $out \
|
||||
--set NODE_ENV production
|
||||
--set NODE_ENV ${if production then "production" else "development"}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue