5284 Commits

Author SHA1 Message Date
Skye Soss
130ca7de82 libgit2: add linking exception
libgit2's license includes a very permissive GPLv2 exception that covers
both static and dynamic linking.
2026-08-23 15:26:45 -05:00
Ryan Hendrickson
6a67cb2c6a sudo: update license (#555029) 2026-08-22 23:42:33 +00:00
Fabian Affolter
2ce99ed957 volatility3: use license from lib.licenses (#554235) 2026-08-21 22:44:13 +00:00
John Ericson
048a0628c6 Switch Cygwin over to GCC NG (#552087) 2026-08-21 21:25:17 +00:00
John Ericson
9f160d0987 lib.systems: build Cygwin with the split GCC package set
Cygwin is the first platform to select `useGccNG`, and it is the natural
one: its libc is partly C++, so building `newlib-cygwin` needs C++ headers
before any libc exists. The monolithic compiler handles that with a
Cygwin-specific `langCC = stdenv.targetPlatform.isCygwin`; the split set
has a stage that provides them, `libstdcxx-no-libc`, which the preceding
commits add and wire in.

Derived from the platform rather than set on the example spec, so it holds
for any Cygwin triple, alongside the `useLLVM` rule it sits under. The
comment saying no platform selects it is retired here, since that is what
this changes.

This changes what `pkgsCross.x86_64-cygwin` builds with for everyone, not
only for callers passing the flag. Verified by building
`gccNGPackages.{libgcc,libstdcxx,libstdcxx-no-libc}` and `stdenv.cc` with
no `useGccNG` in the invocation; the derivations come out identical to
those built with the flag passed explicitly.

Assisted-by: Claude Code (Claude Opus 5)
2026-08-21 14:31:53 -04:00
jopejoe1
96e29804b9 lib.licenses: drop sudo in favor of isc
The license text matches `ISC` and spdx is seems to be in agreement with this https://github.com/spdx/license-list-XML/issues/3010
2026-08-21 14:38:03 +02:00
jopejoe1
e393993ce9 lib.licenses: add bsdAskToEndorse 2026-08-21 13:17:55 +02:00
jopejoe1
2cd094f44e lib.licenses: mark vol-sl as unfree
Fails to pass Debian's `The Desert Island test` and `The Dissident test`
2026-08-21 08:04:34 +02:00
jopejoe1
3e4029f40e lib.licenses: add OFL-1.0 2026-08-19 10:02:39 +02:00
Jo
6783a94425 sqlite: use blessing license (#550129) 2026-08-18 07:30:48 +00:00
jopejoe1
8b944a5d05 lib.licenses: add valveSDK 2026-08-13 17:03:22 +02:00
Eman Resu
761f9ebfce lib.fileset: Optimise source filters (#549885) 2026-08-13 00:13:20 +00:00
John Ericson
33589cc0c6 lib/systems: derive more platform metadata instead of restating it
`examples.nix` had settings that only repeated what the `config` already
implied. They read as if the platform were special, when it ought to be
the default. Now the default logic in `default.nix` ought to handle the
setting in question in a rule-based way so it is.

 Change:

- `useLLVM` now covers
  - UEFI
  - MSVC CRT and C++ ABI
  - Windows on AArch64 as well as FreeBSD and OpenBSD

- `libc` gains a UEFI case

hat retires seven `useLLVM` settings, eighteen `libc = "newlib"`, one
`libc = "bionic"`, and the `libc`/`linker` pair on the UEFI examples.

The remaining `libc`s in examples now means"this differs from what the
triple implies", which is true of the seven left: `newlib-nano`, the
mingw `msvcrt`/`ucrt` pairs those entries exist to distinguish, and
`mmix`, whose OS is `mmixware` rather than `none` so the bare-metal
default does not reach it. That one gains a comment.

No functional change. Elaborating all 87 platforms in
`lib.systems.examples` before and after gives byte-identical `config`,
`system`, `useLLVM`, `useGccNG`, `libc`, `linker` and
`rust.rustcTarget`. `mmix` surfaced that way, having regressed to
`native/impure`.

Assisted-by: Claude Code (Claude Opus 5)
2026-08-12 19:38:22 -04:00
Eman Resu
ef34f35e45 lib.fileset: start by recursing into the initial element
This is guaranteed to be safe. The tree can be a simple string if the
fileset is the same as the root, but the `or` takes care of that. In the
`or` case, the tree is guaranteed to fail the isAttrs check, and so even
though the index is invalid, it won't matter.
2026-08-12 19:37:08 -04:00
John Ericson
92144940a3 gcc/ng: let a platform opt in with useGccNG
Nothing could select the split GCC package set, so none of the fixes
below this commit were reachable from a normal build.

Add `useGccNG` alongside the existing `useLLVM`/`useZig`/`useArocc`
choices, and honour it where a compiler is picked: the cross stdenv takes
`gccNGPackages.gcc`, and `stdenvNoLibs`/`stdenvNoLibc` map to
`gccNoLibgcc` and `gccWithLibgcc`. That last pair is the point of the
split. Both currently fall back to `gccCrossLibcStdenv`, because the
monolithic compiler cannot distinguish them; `lib/systems/default.nix`
says as much next to `linker`, noting that we would like to choose the C
compiler and runtime library orthogonally but "due to the monolithic GCC
build we cannot actually make those choices independently". This is what
lifts that, the way the LLVM set already splits `clangNoCompilerRt` from
`clangNoLibc`.

`gccNGPackages` tracks `default-gcc-version` rather than naming a
release, so the split set and the monolithic `gcc` stay on the same one.

`useGccNG` defaults to `false` and no platform derives it, so no existing
build changes. Setting it on a platform spec is enough to exercise the
whole stack:

    nix-build . -A stdenv.cc --arg crossSystem \
      '{ config = "aarch64-unknown-linux-musl"; useGccNG = true; }'

The intent is to switch obscure low-tier platforms over to it soon --
NetBSD first -- so `ng` gets dogfooded somewhere the blast radius is
small. Those switches come separately.

Assisted-by: Claude Code (Claude Opus 5)
2026-08-12 16:46:18 -04:00
Eman Resu
3b58c2719e lib.fileset: compare to baseString directly
The stringLength check is equivalent at this point, but having to
actualy create the thunk for calling stringLength is likely slower than
just letting Nix handle the equality check.
2026-08-12 14:09:05 -04:00
Eman Resu
9213fcbd18 lib.fileset: inline let variable only used once 2026-08-12 13:41:44 -04:00
Eman Resu
af732abb9b lib.fileset: partially apply substring logic 2026-08-12 13:37:51 -04:00
Eman Resu
b65b89f2de lib.fileset: move let definition higher up 2026-08-12 13:31:59 -04:00
adisbladis
b93a86f983 lib.fileset: Check the common case first in the toSource filter
The source filter runs on every path underneath the base directory, but
only on the few paths above it.

Reorder the prefix checks so the dominant below-the-base case does a
single substring + comparison instead of two, with an explicit branch
for the path being the base itself (which the previous first check also covered).
2026-08-12 16:31:50 +02:00
adisbladis
c55c59d46c lib.fileset: Don't recurse into files in _normaliseTreeFilter
_normaliseTreeFilter strictly walks the entire file set tree on every
toSource call. File entries (null or a file type string) are already
normalised, so dispatch on the subtree inside the mapAttrs closure
instead of making a recursive call that immediately returns its
argument. This also avoids allocating an unused `path + "/${name}"`
argument thunk for every file.
2026-08-12 16:31:49 +02:00
adisbladis
0d9f8e4f09 lib.fileset: Optimise _unionTrees
This function runs once per directory node per union during lazy tree evaluation.
This makes it one of the hottest paths in lib.fileset for large trees.
It was measuared at ~9% of _total evaluation_ time in a very large monorepo.

This change is a 2-in-1:

- Return singleton lists directly to avoid rebuilding subtrees

- Use foldl instead of findFirstIndex

  This is a hot path so the indexing arithmetic adds up.
2026-08-12 16:22:21 +02:00
h7x4
741494f04d lib: replace map (x: x.attr) with catAttrs 2026-08-10 22:34:53 +09:00
Johannes Kirschbauer
7edf1e43ca lib.lists.findFirstIndex: reimplement without indexing (#550034) 2026-08-08 17:40:09 +00:00
Johannes Kirschbauer
d4f9b38c18 lib.attrsets: performance improvements (#523872) 2026-08-08 15:40:37 +00:00
Robert Hensing
bdc192c43d lib/services/service: add flags and flagFormat options (#546008) 2026-08-07 15:58:33 +00:00
7c6f434c
a75bf2a12b lib.licenses.llgplPreamble: document in a comment 2026-08-07 17:08:39 +02:00
jopejoe1
c106d56e49 lib.licenses: add blessing 2026-08-07 11:33:34 +02:00
Jo
0dbe1ac09d lib.licenses: change llgpl21 to exception (#520411) 2026-08-07 06:41:15 +00:00
Eman Resu
2fe51f1a7a lib.lists.findFirstIndex: reimplement without indexing 2026-08-06 18:59:56 -04:00
Eman Resu
9b7289dfc5 lib: improve implementation of foldAttrs (#547436) 2026-08-06 22:25:55 +00:00
Eman Resu
9770889ecf lib: improve implementation of overrideExisting (#549843) 2026-08-06 22:25:08 +00:00
jopejoe1
a4340ecc47 lib.licenses: add w3c-20150513 2026-08-04 12:19:39 +02:00
jopejoe1
4a8a197207 lib.licenses: add qtLgplException11 2026-08-04 12:19:07 +02:00
jopejoe1
2c1ad457b0 lib.licenses: add qtGplException10 2026-08-04 12:18:43 +02:00
jopejoe1
60f68871d7 lib.licenses: add fsfullr 2026-08-04 12:18:21 +02:00
jopejoe1
5bbd03b727 lib.licenses: add gccException31 2026-08-04 12:16:38 +02:00
jopejoe1
7f94e89554 lib.licenses: add bisonException22 2026-08-04 12:16:17 +02:00
daroche
d8ead6d05e lib.licenses: add FSFAP 2026-08-03 22:30:22 +02:00
Artemis Tosini
c41cd7fd36 lib.systems: add GOARCH for big-endian mips64 (#539363) 2026-08-03 15:19:39 +00:00
h7x4
331c4cf699 lib: improve implementation of foldAttrs 2026-07-31 01:35:00 +09:00
h7x4
e74c1dad9d lib: improve implementation of overrideExisting 2026-07-30 23:55:19 +09:00
·𐑑𐑴𐑕𐑑𐑩𐑤
5241238f68 lib/systems: add picolibc 2026-07-28 22:33:36 -07:00
Sam Pointon
bd6051aa5f systems: also rename pkgsCross.wasi32, leaving aliases 2026-07-28 19:50:03 +01:00
Sam Pointon
629b4ee093 systems: rename extant wasi targets to wasip1
Wasi P2 is different enough to Wasi P1 to warrant being treated entirely 
separately, rather than as two minor variants of the same thing. P3 will 
likewise want to be a different target.

I've left aliases in place; maybe eventually, those can be deprecated 
and removed. I've tested this, but it's possible there might be breakage 
somewhere (e.g., the canonical doubles for P1 have changed, though I 
can't imagine why anyone would rely on that).

Fixes https://github.com/NixOS/nixpkgs/issues/435954
2026-07-28 19:50:03 +01:00
Eman Resu
5c483d4767 various: partially apply prefix/suffix/infix checks (#543869) 2026-07-26 21:41:24 +00:00
cinereal
639d4f74e5 lib/services/service: pin flag ordering relative to argv
`attrListWith` re-emits every flag as an `lib.mkOrder` definition, so `argv` and
`flags` share one ordering space. Unadorned flags arrived at
`lib.modules.defaultOrderPriority`, the same priority as unadorned `argv`, and
only landed after `argv` because the declaring module's `config` happened to be
collected last.

Give flags that carry no ordering property of their own a priority of 1250,
between `lib.modules.defaultOrderPriority` and `lib.mkAfter`. Plain flags now
provably follow plain `argv`, `lib.mkAfter` on `argv` still places trailing
positional arguments after the flags, and an explicit `lib.mkOrder` on a flag is
honoured verbatim, which is what interleaving a sub-command among flags needs.

Also render path flag values through `pathOrStr`. `lib.cli.toCommandLine`
formats values with `lib.generators.mkValueStringDefault`, which has no case for
paths and aborts; coercing first yields the store path, matching `argv`.

Assisted-by: Claude:claude-opus-5
2026-07-26 17:02:34 +02:00
lassulus
85f295f566 lib/services/service: add flags and flagFormat options
Add `process.flags` for declarative command-line flag generation
using `lib.cli.toCommandLine`, with per-flag ordering via valueMeta.
Add `process.flagFormat` to control flag rendering.
2026-07-26 16:48:41 +02:00
cinereal
58558fec0b lib/services: fix test expectations for the reload options
`process` gained `reloadCommand` and `reloadSignal`, and every service now
carries an assertion guarding their combination, so the expected values in
`test.nix` no longer matched.

Compare only `process.argv` and only the assertions that are violated, so the
test keeps expressing what it is about rather than restating every option.

Assisted-by: Claude:claude-opus-5
2026-07-26 16:46:03 +02:00
Jo
e9ca7aa0bd python3Packages.flask-reverse-proxy-file: use lib.licenses.ogluk30 (#540724) 2026-07-25 16:59:17 +00:00