|
18 | 18 | versionsData = builtins.fromJSON (builtins.readFile ./versions.json); |
19 | 19 | versionMap = versionsData.versions; |
20 | 20 |
|
21 | | - # The default version shown as `packages.<system>.default`. |
22 | | - # Set "default" in versions.json to override; falls back to "22.22". |
23 | 21 | defaultVersion = versionsData.default or "22.22"; |
24 | | - |
25 | | - # Converts "22.22" → "22_22" for use as Nix attribute names. |
26 | 22 | sanitizeVersion = builtins.replaceStrings [ "." ] [ "_" ]; |
27 | 23 |
|
28 | 24 | systems = [ |
|
96 | 92 | # Create yarn packages bundled with the specific node version. |
97 | 93 | # Uses the version-pinned nixpkgs to ensure yarn/node compatibility. |
98 | 94 | # Falls back to latest nixpkgs if yarn is absent from the pinned rev. |
99 | | - # yarn.override is a callable attrset (same structure as pnpm); __functionArgs |
100 | | - # is checked before calling to guard against future packaging changes. |
101 | 95 | yarnPackages = nixpkgs.lib.mapAttrs' ( |
102 | 96 | version: pkg: |
103 | 97 | let |
|
130 | 124 | # it; otherwise we use pnpm as-is. |
131 | 125 | # |
132 | 126 | # Falls back to latest nixpkgs pnpm only when the pinned rev has no pnpm at |
133 | | - # all (rare, but guards against evaluation errors). The fallback also applies |
134 | | - # the same __functionArgs guard for consistency. |
| 127 | + # all. |
135 | 128 | pnpmPackages = nixpkgs.lib.mapAttrs' ( |
136 | 129 | version: pkg: |
137 | 130 | let |
|
151 | 144 |
|
152 | 145 | pnpmPkg = |
153 | 146 | if builtins.isNull pinnedPnpm then |
154 | | - # Pinned rev has no pnpm at all; fall back to unstable nixpkgs. |
155 | | - # Apply the same __functionArgs guard — pkgs is always modern but |
156 | | - # defensive coding avoids future breakage. |
157 | 147 | let |
158 | 148 | fallbackOverride = pkgs.pnpm.override or null; |
159 | 149 | canOverrideFallback = |
|
170 | 160 | nixpkgs.lib.nameValuePair ("pnpm_" + sanitizeVersion version) ( |
171 | 161 | pkgs.symlinkJoin { |
172 | 162 | name = "pnpm-" + version; |
173 | | - # pkg first: symlinkJoin uses lndir which skips existing symlinks, |
174 | | - # so the first path wins on conflict. pkg must win for node/npm/npx. |
175 | 163 | paths = [ |
176 | 164 | pkg |
177 | 165 | pnpmPkg |
|
0 commit comments