Files
nix-config/home/base/core/npm.nix
T
Ryan Yin af084f1eb4 feat(npm): use npmmirror for npm fetches
Set the user-level npm/pnpm registry to npmmirror, and make Nix builds use the same mirror through nixpkgs' npmRegistryOverrides and rewriteURL. The configured Nixpkgs policy is also applied to myNurPkgs and Colmena's nodeNixpkgs so NUR packages such as dsh use the mirror while preserving Colmena parity.
2026-11-01 16:57:57 +08:00

16 lines
450 B
Nix

{ config, ... }:
{
# make `npm install -g <pkg>` happey
# npm - set min-release-age(in days) for supply-chain security
home.file.".npmrc".text = ''
prefix=${config.home.homeDirectory}/.npm
registry=https://registry.npmmirror.com
min-release-age=2
'';
# pnpm - same supply-chain policy as the npm setting above; its value is in minutes, not days
xdg.configFile."pnpm/config.yaml".text = ''
minimumReleaseAge: 2880
'';
}