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 {
|
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; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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 = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue