Commit Graph

5275 Commits

Author SHA1 Message Date
Ulysses Zhan
ef398065f1 lib.sourceTypes: add obfuscatedCode 2026-04-02 20:42:34 -07:00
cinereal
7334dd9096 lib.types: add types.option
Signed-off-by: cinereal <cinereal@riseup.net>
2026-04-02 12:10:29 +02:00
Robert Hensing
ff011b00be lib/modules: Improve errors involving pushDownProperties (#502117) 2026-04-01 16:00:01 +00:00
Timothy Gallion
f32c37b88c lib.types.defaultTypeMerge: Fix for functors with no wrapped attr
Downstream types that want to use `lib.types.defaultTypeMerge` must include
`wrapped` even though it is deprecated or the internal
`wrappedDeprecationMessage`. This is caused by accessing the
`wrapped` attr in `lib.types.defaultTypeMerge`. The logic should first check
if the attr exists and then if it does check if it is null.
2026-03-29 15:14:00 -04:00
Emily
c9fd2f4d87 lib/systems: remove redundant conditional 2026-03-29 09:07:03 +10:00
Emily
6fb3a3d12b lib: make warnOnInstantiate recurse into overrideAttrs result (#488797) 2026-03-28 21:39:56 +00:00
ash
d6b7012245 lib: make warnOnInstantiate recurse into overrideAttrs result
This silences many `vimPlugins` warnings that are printed too eagerly
when using `nix search`.
2026-03-28 17:14:44 +00:00
Johannes Kirschbauer
075bb50b1a lib.modules: default to emptyValue (#500104) 2026-03-25 11:00:39 +00:00
cinereal
4c7577dd94 lib.options: reflect emptyValue-based option defaults in documentation
Signed-off-by: cinereal <cinereal@riseup.net>
2026-03-24 14:02:55 +01:00
Artem Leshchev
fb932783c4 lib.licenses.bzip2: add
The identifier is not versioned, as the version there is an artifact of
an incorrect interpretation of the documentation, other variants are now
deprecated.
2026-03-23 13:14:25 -05:00
cinereal
ac0ef82504 lib.modules: default to emptyValue
Signed-off-by: cinereal <cinereal@riseup.net>
2026-03-23 16:04:32 +01:00
dramforever
d48a370de1 lib/modules: Add error message test for pushing down non-attrsets 2026-03-22 14:11:01 +08:00
Philip Taron
9ff9393b2b lib.makeScope: allow overriding callPackage (#500752) 2026-03-22 06:03:40 +00:00
dramforever
413f4666cd lib/modules: Improve errors involving pushDownProperties
If an attrset option was given a definition like:

    { system = lib.mkIf true false; }

Before this change, we get the non-explanatory error message:

    error: expected a set but found a Boolean: true

With the stack trace having nothing to do with the module involved.
After this change, we get the better:

    error: In module `[...]', you're trying to define a value of type `bool' [...]

Which names the actual module involved.
2026-03-22 13:53:50 +08:00
Alyssa Ross
1304639262 lib.meta.getLicenseBySpdxId: set spdxId in default value (#500750) 2026-03-20 15:23:17 +00:00
Philip Taron
4085f24e25 lib.makeScope: add tests for callPackage overriding
Test that:
- makeScope provides a default callPackage
- the scope function can override callPackage
- the override persists through overrideScope
2026-03-19 14:11:11 -07:00
Aleksana
c9fdda7d5a lib/systems: fix qemuArch for aarch64_be (#500620) 2026-03-18 14:06:22 +00:00
quantenzitrone
f08c835bf9 lib.newScope: allow overriding callPackage 2026-03-17 16:30:00 +01:00
sternenseemann
666476ff53 lib.meta.getLicenseBySpdxId: set spdxId in default value
Nixpkgs does not contain an entry in lib.licenses for every SPDX license,
so it is expected that a valid SPDX id would yield no proper result from
getLicenseFromSpdxId. Hence, we should set spdxId in the default value.

Users that think their SPDX ID may be invalid should rather use
getLicenseFromSpdxIdOr.
2026-03-17 16:16:43 +01:00
Amaan Qureshi
e0801cae76 lib/systems: fix qemuArch for aarch64_be
`qemuArch` returned "aarch64" for both LE and BE, causing binfmt to
register `qemu-aarch64` for `aarch64_be` binaries. QEMU ships separate
`qemu-aarch64` and `qemu-aarch64_be` binaries, so the wrong interpreter
was used, failing with "Invalid ELF image for this architecture".

Since QEMU distinguishes endianness in the binary name, this adds the
"_be" suffix via `isBigEndian`, which is similar to the approach MIPS 
uses a few lines below.
2026-03-16 23:49:50 -04:00
cinereal
fe13778496 lib.types: use isType for optionType
Signed-off-by: cinereal <cinereal@riseup.net>
2026-03-14 16:18:56 -07:00
lenny
877bfea988 licenses: add liliq-p-1.1 2026-03-11 21:14:03 +01:00
Alyssa Ross
bd0c7ad05a lib.systems: rust: Make rustcTargetSpec the primary entrypoint (#446668) 2026-03-07 08:22:44 +00:00
Tobias Mayer
4c05f197e6 lib.systems: s/makeMuslParsedPlatform/mkMuslSystem/ 2026-03-06 23:38:09 +01:00
Tristan Ross
3faec18180 lib.systems: expose makeMuslParsedPlatform (#490520) 2026-03-06 16:37:06 +00:00
İlkecan Bozdoğan
6acae46c84 lib: don't inherit unused functions 2026-03-04 00:10:00 +03:00
İlkecan Bozdoğan
e394a579b0 lib: update type signatures
- concrete types start with uppercase: Int, String, Bool, Derivation,
  etc.
- type variables start with lowercase: a, b, etc.
- list:
  - use `[x]` for homogeneous lists instead of `List x` or `[ x ]`
  - use `List` for heterogeneous lists (not that common in `lib`)
- attr:
  - use `AttrSet` for a generic attribute set type
  - use `{ key1 :: Type1; key2 :: Type2; ... }` for adding signatures
    for known attribute names and types
  - use `{ key1 = value1; key2 = value2; ... }` for adding attributes
    with known literals
  - end with an ellipsis (`...`) if the set can contain unknown
    attributes
  - use `{ [String] :: x }` if all the attributes has the same type `x`
- prefer `Any` over `a` if the latter is not reused
2026-03-04 00:10:00 +03:00
İlkecan Bozdoğan
64a8ada54e lib: add type signature to some of the functions 2026-03-02 15:46:43 +00:00
John Ericson
704e1a5c16 lib.systems: add uefi support (#477645) 2026-03-02 05:32:37 +00:00
dramforever
60ac986e49 lib.systems: rust: Make rustcTargetSpec the primary entrypoint
Make rustcTargetSpec the primary entrypoint for setting a custom target,
and wire up all the other stuff so they are hopefully as working and as
broken as before.

In particular, to specify a custom target, the user now just specifies
rust.rustcTargetSpec. rust.platform and rust.cargoShortTarget are
populated from rust.rustcTargetSpec now. In addition, rust.rustcTarget
defaults to rust.cargoShortTarget. (rust.rustcTarget and
rust.cargoShortTarget really should always be the same, but I think we
can deal with that later).

This allows the user to more easily control the basename of
rust.rustcTargetSpec by passing e.g.
"${./rust}/mips64el_mips3-unknown-linux-gnuabi64.json", which allows
cc-rs and in turn std to work.
2026-02-27 13:34:31 +08:00
dramforever
550a1b8eb5 lib.systems: Refactor rust.platform generation
In preparation for a future commit, refactor rust.platform somewhat.

No functional changes intended. Most of the diff here is whitespace
changes.
2026-02-25 11:18:23 +08:00
Tom Hunze
7d233ecede lib.licenses.tsl: fix typo in fullName 2026-02-18 17:52:45 +01:00
Silvan Mosberger
9895f5057d lib.maintainers: Require uniqueness of github[Id], email and matrix fields (#488851) 2026-02-16 20:57:43 +00:00
Tobias Mayer
4cd3967a68 lib.systems: expose makeMuslParsedPlatform
Moving this helper from pkgs/stdenv/stage.nix so it can be used
for alternative variations of pkgsMusl and pkgsStatic.
2026-02-14 23:09:33 +01:00
Alexandre Esteves
4255fb08c9 lib.systems: fix path to wine executable 2026-02-10 20:16:44 +00:00
piegames
09511292b0 lib: fix broken string escapes in doc comments (#486608) 2026-02-10 13:49:42 +00:00
Silvan Mosberger
b54233e11c lib.maintainers: Enforce unique github[Id], email, matrix 2026-02-09 21:51:01 +01:00
nixpkgs-ci[bot]
c0bf6b8395 Merge master into staging-nixos 2026-02-04 00:22:54 +00:00
Silvan Mosberger
58b187378d lib/modules: add suggestions to invalid option name errors (#442263) 2026-02-03 19:10:35 +00:00
quantenzitrone
47124583fc lib: fix broken string escapes in doc comments 2026-02-03 18:04:11 +01:00
Alyssa Ross
95c8d1ec1e lib/systems/platforms: Add ppc64; linux: Add 64-bit POWER settings, strip vmlinux kernels (#447752) 2026-02-02 12:10:28 +00:00
nixpkgs-ci[bot]
98a177a424 Merge master into staging-nixos 2026-01-28 12:09:43 +00:00
Theo Paris
9f605ca95e lib.systems: add uefi support
Signed-off-by: Theo Paris <theo@theoparis.com>
Change-Id: I51ce15449fc83f0ff39277d7cde7b34a6a6a6964

lib.systems: remove i686-uefi
2026-01-25 21:59:21 -08:00
Alexandre Esteves
03a5813e98 lib/systems: Add nodejs as emulator for pkgsCross.ghcjs 2026-01-25 23:16:19 +00:00
Michael Daniels
006ecdbdeb treewide: fix typos (#479869) 2026-01-24 21:36:44 +00:00
Niclas Overby
7b16ea8b4e lib: re-export missing pure builtins in lib 2026-01-24 11:10:58 +01:00
Johannes Kirschbauer
c6578a37be lib: re-export missing builtins in lib (#482743) 2026-01-23 09:34:19 +00:00
Dyego Aurélio
28096cc5e3 treewide: apply nixfmt 1.2.0 2026-01-22 18:37:56 -03:00
Mikalai Seva
cb9cd986c9 lib: re-export missing builtins in lib
Closes #369215
2026-01-22 18:54:30 +01:00
Fabián Heredia Montiel
82c1a79c43 Merge remote-tracking branch 'origin/master' into staging-next 2026-01-22 10:40:19 -06:00