|
191 | 191 |
|
192 | 192 | aliases = self: super: lib.optionalAttrs config.allowAliases (import ./aliases.nix lib self super); |
193 | 193 |
|
| 194 | + variants = import ./variants.nix { |
| 195 | + inherit |
| 196 | + lib |
| 197 | + nixpkgsFun |
| 198 | + stdenv |
| 199 | + overlays |
| 200 | + makeMuslParsedPlatform |
| 201 | + ; |
| 202 | + }; |
| 203 | + |
194 | 204 | # stdenvOverrides is used to avoid having multiple of versions |
195 | 205 | # of certain dependencies that were used in bootstrapping the |
196 | 206 | # standard environment. |
|
214 | 224 | # - pkgsCross.<system> where system is a member of lib.systems.examples |
215 | 225 | # - pkgsMusl |
216 | 226 | # - pkgsi686Linux |
| 227 | + # NOTE: add new non-critical package sets to "pkgs/top-level/variants.nix" |
217 | 228 | otherPackageSets = self: super: { |
218 | 229 | # This maps each entry in lib.systems.examples to its own package |
219 | 230 | # set. Each of these will contain all packages cross compiled for |
|
222 | 233 | # Raspberry Pi. |
223 | 234 | pkgsCross = lib.mapAttrs (n: crossSystem: nixpkgsFun { inherit crossSystem; }) lib.systems.examples; |
224 | 235 |
|
225 | | - pkgsLLVM = nixpkgsFun { |
226 | | - overlays = [ |
227 | | - (self': super': { |
228 | | - pkgsLLVM = super'; |
229 | | - }) |
230 | | - ] ++ overlays; |
231 | | - # Bootstrap a cross stdenv using the LLVM toolchain. |
232 | | - # This is currently not possible when compiling natively, |
233 | | - # so we don't need to check hostPlatform != buildPlatform. |
234 | | - crossSystem = stdenv.hostPlatform // { |
235 | | - useLLVM = true; |
236 | | - linker = "lld"; |
237 | | - }; |
238 | | - }; |
239 | | - |
240 | | - pkgsArocc = nixpkgsFun { |
241 | | - overlays = [ |
242 | | - (self': super': { |
243 | | - pkgsArocc = super'; |
244 | | - }) |
245 | | - ] ++ overlays; |
246 | | - # Bootstrap a cross stdenv using the Aro C compiler. |
247 | | - # This is currently not possible when compiling natively, |
248 | | - # so we don't need to check hostPlatform != buildPlatform. |
249 | | - crossSystem = stdenv.hostPlatform // { |
250 | | - useArocc = true; |
251 | | - linker = "lld"; |
252 | | - }; |
253 | | - }; |
254 | | - |
255 | | - pkgsZig = nixpkgsFun { |
256 | | - overlays = [ |
257 | | - (self': super': { |
258 | | - pkgsZig = super'; |
259 | | - }) |
260 | | - ] ++ overlays; |
261 | | - # Bootstrap a cross stdenv using the Zig toolchain. |
262 | | - # This is currently not possible when compiling natively, |
263 | | - # so we don't need to check hostPlatform != buildPlatform. |
264 | | - crossSystem = stdenv.hostPlatform // { |
265 | | - useZig = true; |
266 | | - linker = "lld"; |
267 | | - }; |
268 | | - }; |
269 | | - |
270 | | - # All packages built with the Musl libc. This will override the |
271 | | - # default GNU libc on Linux systems. Non-Linux systems are not |
272 | | - # supported. 32-bit is also not supported. |
273 | | - pkgsMusl = |
274 | | - if stdenv.hostPlatform.isLinux && stdenv.buildPlatform.is64bit then |
275 | | - nixpkgsFun { |
276 | | - overlays = [ |
277 | | - (self': super': { |
278 | | - pkgsMusl = super'; |
279 | | - }) |
280 | | - ] ++ overlays; |
281 | | - ${if stdenv.hostPlatform == stdenv.buildPlatform then "localSystem" else "crossSystem"} = { |
282 | | - config = lib.systems.parse.tripleFromSystem (makeMuslParsedPlatform stdenv.hostPlatform.parsed); |
283 | | - }; |
284 | | - } |
285 | | - else |
286 | | - throw "Musl libc only supports 64-bit Linux systems."; |
287 | | - |
288 | 236 | # All packages built for i686 Linux. |
289 | 237 | # Used by wine, firefox with debugging version of Flash, ... |
290 | 238 | pkgsi686Linux = |
|
376 | 324 | // stdenv.hostPlatform.gcc or { }; |
377 | 325 | }; |
378 | 326 | }); |
379 | | - |
380 | | - # Full package set with rocm on cuda off |
381 | | - # Mostly useful for asserting pkgs.pkgsRocm.torchWithRocm == pkgs.torchWithRocm and similar |
382 | | - pkgsRocm = nixpkgsFun ({ |
383 | | - config = super.config // { |
384 | | - cudaSupport = false; |
385 | | - rocmSupport = true; |
386 | | - }; |
387 | | - }); |
388 | | - |
389 | | - pkgsExtraHardening = nixpkgsFun { |
390 | | - overlays = [ |
391 | | - ( |
392 | | - self': super': |
393 | | - { |
394 | | - pkgsExtraHardening = super'; |
395 | | - stdenv = super'.withDefaultHardeningFlags ( |
396 | | - super'.stdenv.cc.defaultHardeningFlags |
397 | | - ++ [ |
398 | | - "shadowstack" |
399 | | - "nostrictaliasing" |
400 | | - "pacret" |
401 | | - "trivialautovarinit" |
402 | | - ] |
403 | | - ) super'.stdenv; |
404 | | - glibc = super'.glibc.override rec { |
405 | | - enableCET = if self'.stdenv.hostPlatform.isx86_64 then "permissive" else false; |
406 | | - enableCETRuntimeDefault = enableCET != false; |
407 | | - }; |
408 | | - } |
409 | | - // lib.optionalAttrs (with super'.stdenv.hostPlatform; isx86_64 && isLinux) { |
410 | | - # causes shadowstack disablement |
411 | | - pcre = super'.pcre.override { enableJit = false; }; |
412 | | - pcre-cpp = super'.pcre-cpp.override { enableJit = false; }; |
413 | | - pcre16 = super'.pcre16.override { enableJit = false; }; |
414 | | - } |
415 | | - ) |
416 | | - ] ++ overlays; |
417 | | - }; |
418 | 327 | }; |
419 | 328 |
|
420 | 329 | # The complete chain of package set builders, applied from top to bottom. |
|
430 | 339 | allPackages |
431 | 340 | otherPackageSets |
432 | 341 | aliases |
| 342 | + variants |
433 | 343 | configOverrides |
434 | 344 | ] |
435 | 345 | ++ overlays |
|
0 commit comments