Commit graph

4,994 commits

Author SHA1 Message Date
Nick Cao
7ed8aa763c
nbd: 3.25 -> 3.27.1 (#515240) 2026-05-07 20:49:02 +00:00
Alyssa Ross
a5974a5550
nim: deprecate and move os and cpu to stdenv.targetPlatform.nim (#513302) 2026-05-06 16:10:53 +00:00
eveeifyeve
a8f0a99212 nim: deprecate and move os and cpu to stdenv.targetPlatform.nim
This change makes it more accesssable to using nim cpu and os without
referencing nim.
2026-05-06 22:29:23 +10:00
jopejoe1
aac795740f lib.licenses: add w3c-19980720 2026-05-06 10:50:57 +02:00
Alyssa Ross
1b58ebe645
mpich: set license to mpich2 (#516853) 2026-05-05 15:20:19 +00:00
jopejoe1
6821c758f5 lib.licenses: add bsd3Modification 2026-05-04 13:02:34 +02:00
Alyssa Ross
a58377983f
lib.systems: various small performance improvements (#514493) 2026-05-04 08:15:54 +00:00
Eman Resu
acd5585a3b lib.systems.parse: check if cpus are equal first
Rather than doing this last, we do it first. Saves a little time if
we're comparing to an identical platform
2026-05-03 16:49:37 -04:00
Alyssa Ross
ff7579709b
stdenv/check-meta: various performance cleanups (#514492) 2026-05-03 17:26:37 +00:00
Alyssa Ross
d474d1d274
lib/customization: various performance improvements (#515116) 2026-05-03 15:19:24 +00:00
Eman Resu
0b29c3289e lib.callPackageWith: check if args are already empty before handling defaults 2026-05-03 08:23:34 -04:00
Eman Resu
efd9c79a80 lib.callPackageWith: filter names instead of attributes 2026-05-03 08:23:33 -04:00
Eman Resu
54cbe35bf9 lib.callPackageWith: use custom version of filterAttrs
Avoids a double-negation and passing the name every time.
2026-05-03 08:23:33 -04:00
Eman Resu
caab17b274 lib.callPackageWith: move error message variables out of happy path 2026-05-03 08:23:32 -04:00
Eman Resu
6a07020e3c lib.overrideDerivation: rewrite to not be utterly ridiculous
Why are we running a `flip` on arguments we can control? Why are we
using `or` on one line only to use a full if/else on the next line? Why
are we merging with {}, and why have we been doing it for three years?
THese are the questions I ask myself.
2026-05-03 08:23:32 -04:00
Eman Resu
a72cd26ceb lib.makeOverridable: avoid some function calls 2026-05-03 08:23:26 -04:00
Eman Resu
833f05d099 lib.systems.elaborate: prevent unnecessary attrset merges 2026-05-03 08:04:34 -04:00
Eman Resu
a9c0a094f7 lib.systems.elaborate: avoid optionalAttrs merge 2026-05-03 08:04:34 -04:00
Eman Resu
7fcbff801d lib.systems.parse: only check condition once 2026-05-03 08:04:33 -04:00
Eman Resu
577b481774 lib.systems.parse: use builtins.head foo instead of elemAt foo 0 2026-05-03 08:04:28 -04:00
Rasheeq Azad
29101432aa lib.systems.architectures: add rocketlake 2026-05-02 18:47:17 -04:00
Nick Cao
ba4edac0a4
lib.licenses: add DocBook DTD License 2026-05-02 08:45:24 -04:00
Michael Daniels
18e82c4591
lib: remove unused let bindings and args@{} uses 2026-04-30 18:43:56 -04:00
Eman Resu
3227158021 lib.meta.availableOn: move negation outside loop
Also exit early without meta.badPlatforms. This is a very hot function
thanks to its usage in stdenv check-meta.
2026-04-29 09:00:26 -04:00
Eman Resu
cb1edb8183 lib.makeOverridable: inline helper function into its usages
Also perform some manual beta reductions.
2026-04-28 13:59:32 -04:00
Eman Resu
c33811716d lib.makeOverridable: avoid optionalAttrs merge 2026-04-28 13:59:32 -04:00
Eman Resu
1e022acbf5 lib.makeOverridable: inline several variables 2026-04-28 13:59:32 -04:00
Eman Resu
8ccea3bf6c lib.extendDerivation: avoid optionalAttrs merge 2026-04-28 13:59:32 -04:00
Eman Resu
6325e7ff14 lib.extendDerivation: inline variables 2026-04-28 13:59:31 -04:00
Robert Hensing
629f0f2c6c
lib/filesystem: remove absolute path literals (#514225) 2026-04-28 15:48:47 +00:00
John Ericson
fad35427aa
lib/sources: remove absolute path literals (#514226) 2026-04-28 14:22:35 +00:00
Johannes Kirschbauer
5c9f6077a7
lib/concatLines: add test for empty list 2026-04-28 10:08:32 +02:00
Johannes Kirschbauer
66f4e5d988
Revert "lib/strings.concatLines: call concatStringsSep directly"
This reverts commit d7e6988c9b.
2026-04-28 10:04:39 +02:00
Ameer Taweel
ecf55714fe lib/sources: remove absolute path literals 2026-04-28 01:00:25 +03:00
Ameer Taweel
c6e1981fa2 lib/filesystem: remove absolute path literals 2026-04-28 00:59:06 +03:00
Johannes Kirschbauer
5d7c257e33
lib/services: improve configure function documentation (#508211) 2026-04-25 21:07:57 +00:00
jopejoe1
2b7f24eeb8 lib.licenses: add mpich2 2026-04-23 15:19:58 +02:00
Ben Siraphob
0f420e96c4 gcc, libgcc: fix cross-compilation for SH4
- Pass --with-multilib-list=m4,m4-nofpu for SH4 so the kernel can use
  -m4-nofpu. Move libraries out of !m4/ multilib subdirectory in
  postInstall before moveToOutput.
- Generate sysroot-suffix.h for SH4 in the standalone libgcc builder.
- Add linux-kernel.target = "vmlinux" and installTarget for SH4.

All changes scoped to isSh4 to avoid rebuilds on other platforms.
2026-04-20 13:02:20 -07:00
Ben Siraphob
0fcb031c25 lib/systems: add SH4 (SuperH) cross-compilation target
Add sh4 CPU type (32-bit, little-endian, family "sh"), isSh4 predicate,
"sh4-linux" system double, cross-compilation example (sh4-unknown-linux-gnu),
linuxArch mapping to "sh", and test entry.
2026-04-20 13:02:20 -07:00
Alyssa Ross
c27781ea44
lib.licenses: add universalFOSSException-10 (#511720) 2026-04-20 11:47:53 +00:00
jopejoe1
f8bcedf147 lib.licenses: add universalFOSSException-10 2026-04-20 13:35:06 +02:00
Robert Hensing
77b5864637 lib.modules: submodule emptyValue must evaluate sub-option defaults
`emptyValue` for `types.submodule` was `{ value = { }; }`, i.e. none
of the type-declared options or their defaults.

Previously submodules without defs would simply fail for lack of a default,
but since PR #500104 repurposed `emptyValue` as the fallback when no
definitions exist, submodule options without an explicit `default = { }`
(new additions) silently lost their sub-option defaults
(e.g. `requiredFeatures.devnet` in the nixos-test-driver, #511413).

Main change: `emptyValue`: `{ }` -> `{ value = base.config; }`

Additionally, skip `emptyValue`-based default rendering in docs for
types with submodules, because their sub-options are already documented
individually, and forcing evaluation here can break on modules with
invalid or incomplete definitions.
2026-04-19 20:52:33 +01:00
Robert Hensing
3a1a279cf8
lib/modules: reduce allocations in evalModules and mergeModules (#510048) 2026-04-19 17:21:54 +00:00
Ben Siraphob
b787ee3d40 lib/modules: reduce allocations in evalModules and mergeModules
- When `evalModules` is called without deprecated `args`/`check` parameters (the common case), avoid `modules ++ []` which copies the entire module list for no reason.
- `collectModules` was calling `collectStructuredModules` twice with identical arguments — once for `filterModules` and once for `toGraph`. Share the result via a `let` binding.
- Replace `zipAttrsWith (n: v: v)` with `zipAttrs`
- Replace `concatMap` with `filter`+`map` in `filterOverrides'`

NixOS minimal eval improvement: -5.0% list_concats, -1.2%
nrFunctionCalls, -0.7% nrThunks, -1.0% envs, -1.5% list_bytes.
2026-04-19 09:52:40 -07:00
jopejoe1
dbdb37908f lib/tests: add tests for lib.licenses 2026-04-19 12:22:11 +02:00
jopejoe1
bb8e1c54e9 lib.licenses: add compound licenses 2026-04-19 12:22:11 +02:00
Alyssa Ross
7251a763b7
lib/systems: fix incorrect CPU compatibility claims in isCompatible (#509796) 2026-04-19 09:44:23 +00:00
Johannes Kirschbauer
51f38b40cd
lib/strings.concatLines: call concatStringsSep directly (#506077) 2026-04-16 19:32:28 +00:00
Alyssa Ross
4cd3a0ec79
lib/systems: add ARC cross-compilation target (#510160) 2026-04-15 15:51:26 +00:00
Ben Siraphob
6152e8cbfa lib/systems: add ARC (Synopsys DesignWare ARC) cross-compilation support
Add arc CPU type (32-bit, little-endian, family "arc"), isArc
predicate, arc-linux double, arc cross example with
arc-unknown-linux-gnu triple, and release-cross job.

ARC has glibc support and uses the "arc" Linux kernel arch, which
matches the CPU name so no explicit linuxArch mapping is needed.
2026-04-14 13:51:11 -07:00