diff --git a/src/modules/languages/javascript.nix b/src/modules/languages/javascript.nix index fbd3c6439..fe290e818 100644 --- a/src/modules/languages/javascript.nix +++ b/src/modules/languages/javascript.nix @@ -13,11 +13,18 @@ in defaultText = lib.literalExpression "pkgs.nodejs"; description = "The Node package to use."; }; + + corepack = { + enable = lib.mkEnableOption "shims for package managers besides npm"; + }; }; config = lib.mkIf cfg.enable { packages = [ cfg.package - ]; + ] ++ lib.optional cfg.corepack.enable (pkgs.runCommand "corepack-enable" { } '' + mkdir -p $out/bin + ${cfg.package}/bin/corepack enable --install-directory $out/bin + ''); }; }