summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/programs/npm.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/programs/npm.nix b/nixos/modules/programs/npm.nix
index b351d80c7ac..f101a44587a 100644
--- a/nixos/modules/programs/npm.nix
+++ b/nixos/modules/programs/npm.nix
@@ -13,7 +13,14 @@ in
     programs.npm = {
       enable = mkEnableOption "<command>npm</command> global config";
 
-      npmrc = lib.mkOption {
+      package = mkOption {
+        type = types.path;
+        description = "The npm package version / flavor to use";
+        default = pkgs.nodePackages.npm;
+        example = literalExample "pkgs.nodePackages_13_x.npm";
+      };
+
+      npmrc = mkOption {
         type = lib.types.lines;
         description = ''
           The system-wide npm configuration.
@@ -40,7 +47,7 @@ in
 
     environment.variables.NPM_CONFIG_GLOBALCONFIG = "/etc/npmrc";
 
-    environment.systemPackages = [ pkgs.nodePackages.npm ];
+    environment.systemPackages = [ cfg.package ];
   };
 
 }