From 0b3de6803e4b57c9432eb322f67c6126faea7a9e Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 3 Feb 2025 12:48:24 +0100 Subject: [PATCH] Nix: add production flag to package --- flake.nix | 1 + package.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index e12cfa5..ced4fe4 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,7 @@ packages = rec { default = shows-api; shows-api = pkgs.callPackage ./package.nix { }; + shows-api-dev = pkgs.callPackage ./package.nix { production = false; }; }; } ); diff --git a/package.nix b/package.nix index 4078811..40f206b 100644 --- a/package.nix +++ b/package.nix @@ -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 = {