Commit Graph

4744 Commits

Author SHA1 Message Date
nixpkgs-ci[bot]
f5096bbfa6 Merge master into staging-next 2025-06-02 18:05:37 +00:00
Pol Dellaiera
6d9d3014ba treewide: fix typos in comments (#413240) 2025-06-02 18:43:07 +02:00
Johannes Kirschbauer
f54b76bc01 lib/types: add doc warning to addCheck (#412364) 2025-06-02 18:39:27 +02:00
Peder Bergebakken Sundt
c77ac9dfc3 treewide: fix typos 2025-06-02 16:07:07 +02:00
nixpkgs-ci[bot]
bb90e78db3 Merge master into staging-next 2025-06-02 12:06:59 +00:00
Wolfgang Walther
a7f4e0f9ae lib/tests: avoid full rebuild when only maintainers change
The vast majority of CI jobs to build the lib tests are caused by
changes in the maintainer list. In this case, we currently run the full
test-suite which takes 3-4 minutes. By moving the maintainers and teams
tests out of the test-with-nix file, we save almost all of that.
Building only those two tests on a change is almost instant. This only
works, because we previously enabled cachix for the workflow.

Note, that these tests are not actually run with both nix versions, even
though they were listed in the "test with specific nix version" file.
That's because we only differ in the nix version run *inside* the
sandbox, but not doing the outer build.

Since this file seems to be re-used by NixOS/nix' CI, this is
technically a small loss in coverage for that repo, but nixpkgs CI
considerations outweigh that. But because of this, I left the other
non-nix-version-specific tests in that file.
2025-06-02 09:12:19 +02:00
Jan Malakhovski
7c8a4efb68 lib, treewide: introduce repoRevToName, use it in most fetch* functions
This patch adds `lib.repoRevToName` function that generalizes away most of the
code used for derivation name generation by `fetch*` functions (`fetchzip`,
`fetchFromGitHub`, etc, except those which are delayed until latter commits
for mass-rebuild reasons).

It's first argument controls how the resulting name will look (see below).

Since `lib` has no equivalent of Nixpkgs' `config`, this patch adds
`config.fetchedSourceNameDefault` option to Nixpkgs and then re-exposes
`lib.repoRevToName config.fetchedSourceNameDefault` expression as
`pkgs.repoRevToNameMaybe` which is then used in `fetch*` derivations.

The result is that different values of `config.fetchedSourceNameDefault` now
control how the `src` derivations produced by `fetch*` functions are to be
named, e.g.:

- `fetchedSourceNameDefault = "source"` (the default):

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-source.drv
  ```

- `fetchedSourceNameDefault = "versioned"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-source.drv
  ```

- `fetchedSourceNameDefault = "full"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-github-source.drv
  ```

See the documentation of `config.fetchedSourceNameDefault` for more info.
2025-05-31 10:01:21 +00:00
nixpkgs-ci[bot]
3025596725 Merge master into staging-next 2025-05-31 00:16:33 +00:00
Johannes Kirschbauer
7063762d13 lib/types: add doc warning to addCheck 2025-05-30 16:25:44 +02:00
Alyssa Ross
f4c841ae5e lib.systems: don't throw if go unsupported
Better to have a value that can actually be checked for, rather than
throwing, so optional Go support can be disabled when unsupported.
2025-05-30 14:57:33 +02:00
nixpkgs-ci[bot]
aabaf9f281 Merge staging-next into staging 2025-05-29 18:06:18 +00:00
jopejoe1
0b29af4760 xkeyboard-config, xtrans, xorg-{cf-files,docs,sgml-doctools}: refactor and move to pkgs/by-name from xorg namespace (#398391) 2025-05-28 20:58:05 +02:00
Gutyina Gergő
b3b0fd266b lib: prefer replaceString over replaceStrings 2025-05-28 00:20:57 +02:00
Gutyina Gergő
b5720e2b3f lib/strings: init replaceString 2025-05-28 00:20:56 +02:00
Philip Taron
9b3545da9e lib.systems.loongarch64-multiplatform: init (#402689) 2025-05-27 08:48:18 -07:00
Wolfgang Walther
94817274d2 lib.fileset.difference: fix type docs 2025-05-26 22:05:23 +02:00
Weijia Wang
9988795010 lib.systems.loongarch64-multiplatform: init 2025-05-25 14:43:14 +02:00
Zitrone
7e7e5721a6 xorg-docs: refactor, move to pkgs/by-name and rename from xorg.xorgdocs 2025-05-25 05:41:43 +02:00
Emily
98dbc7cc58 Revert "lib.meta.availableOn: Return false if pkg parameter is null"
I believe this change is wrong both theoretically and practically.

Theoretically, `null` is available on every platform, because
`buildInputs = [ null ];` always succeeds and never throws a platform
availability error. `null` should be handled consistently with packages
that have no explicit list of supported platforms, as it of course
has no such list itself.

Practically, we use `null` to represent libraries that are always
present on a platform and do not require a library (for instance,
because they are part of `libc` or the macOS SDK). This has been
used for a long time by `libintl` (on all non‐glibc platforms),
and is also now used by `libGL` and friends on Darwin. This change
broke the check SDL3 does for OpenGL availability on Darwin, causing
<https://github.com/NixOS/nixpkgs/issues/407056>, which had to be
worked around by <https://github.com/NixOS/nixpkgs/pull/409525>.

Both `libintl` and `libGL` should count as available on platforms
where their functionality is part of the standard build environment,
and a package that is completely unavailable and whose functionality
cannot be expected should not use `null`, as it should result in
errors if used in a dependency list on an unsupported platform.

I accept that overriding with `null` is often a useful way to disable
dependencies that don’t have explicit feature flags, but I do not
think that making it work better with feature flags conditioned on
availability is worth the inconsistency and problems caused by this
change. Packages can instead expose the relevant feature flags as
arguments that default to the `lib.meta.availableOn` check or, if they
want to keep an “override the dependency to `null`” interface,
insert an explicit `pkg != null && …` check.

Additionally, the pull request was merged over a week after all
breaking changes were restricted for the 25.05 release. I believe that
the potential problems of dealing with the effects of this change for
an entire release cycle – the first release cycle where `libGL` is
`null` on Darwin, a change I made before the deadline and before this
change to `lib.meta.availableOn` – offset the risks of backporting
this revert at such a late stage.

It will cause overrides to backwards‐incompatibly revert to the
behaviour they had before the change, but since such overrides were
not possible until a few weeks ago, I hope that is an acceptable risk
compared to the potential issues leaving this in the release can
cause, given that it was merged after the deadline and has already
broken an existing construction in Nixpkgs.

This reverts commit 9338d924db.
2025-05-23 15:09:41 +01:00
Aleksana
48b56e8fb5 lib.systems: raise minimum loongarch64 feature support (#403201) 2025-05-23 10:00:37 +08:00
Aleksana
b2fc900a32 lib.systems.elaborate.canExecute: handle different gcc.arch (#403549) 2025-05-23 09:59:10 +08:00
aleksana
54e53047bf lib.systems.examples: separate loongarch64 for desktop and embedded variants 2025-05-22 19:59:54 +08:00
aleksana
b6b5125d03 lib.systems.architectures: add loongarch64 2025-05-22 19:00:07 +08:00
aleksana
1802f697e4 lib.systems.elaborate.canExecute: handle different gcc.arch 2025-05-22 18:57:28 +08:00
aleksana
330fdc9943 lib.systems.architectures: add hasInferior and canExecute function 2025-05-22 18:57:28 +08:00
Simon Hollingshead
6b6e23bfda treewide: maintainers-list.nix -> maintainer-list.nix (#409585) 2025-05-22 15:42:16 +05:30
Johannes Kirschbauer
b7d438b87c lib.strings: init toCamelCase (#402372) 2025-05-18 22:18:39 +02:00
Sigmanificient
6b782a9ebe lib/.version: Fix version file formatting 2025-05-16 19:53:23 +02:00
Leona Maroni
e56e0beed4 25.11 is Xantusia 2025-05-16 19:21:55 +02:00
Arian van Putten
871526be1f nixos/image/repart: Use own assertions / warnings. (#406940) 2025-05-15 19:14:53 +02:00
Aleksana
40a774220d ipxe: correct licensing information (#390934) 2025-05-15 21:42:59 +08:00
Alyssa Ross
7eb2580981 lib.systems.examples.riscv64-musl: init 2025-05-15 14:44:58 +02:00
Morgan Jones
865c1cb0e9 lib/systems: remove android cruft (#406682) 2025-05-14 17:46:48 -07:00
Will Fancher
4b0d1225f5 lib/asserts: Factor out NixOS's toplevel assertion / warning logic. 2025-05-14 01:21:10 -04:00
Fernando Rodrigues
8d21ee745e licenses: add gpl2UBDLPlus
Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-05-13 16:49:21 +00:00
Morgan Jones
9d3c069cbd lib/systems: remove android cruft
These used legacy names for Android SDK and NDK versions, so now we can
do away with them.
2025-05-12 23:43:16 -07:00
Jeremy Fleischman
63c815dd79 docs: fix typo: readDir -> dirOf
The example code here uses `dirOf`, not `readDir`. I assume this was
just a silly typo.
2025-05-12 00:36:30 -07:00
Heitor Augusto
24e8a790b7 lib.strings: init toCamelCase 2025-05-11 20:24:56 -03:00
Matt Sturgeon
1fb1446380 lib.modules.importApply: Fix doc typo; _keykey
The `importApply` docs reference using the `_key` attr along with
`importApply` or `_file`, however the actual attr name used by the
module system is `key`.
2025-05-08 17:48:50 +01:00
Johannes Kirschbauer
5ee93d2532 lib: refactor lib.attrsets.{mapAttrs', mapAttrsToList} and mapAttrs'' in the strongswan-swanctl module (#403581) 2025-05-08 09:42:40 +02:00
ccicnce113424
4551258940 lib: refactor lib.attrsets.{mapAttrs', mapAttrsToList} and mapAttrs'' in the strongswan-swanctl module
The new implementation of `mapAttrsToList` is simpler than the previous one, avoiding an extra string conversion. Benchmarking shows a slight performance improvement. See the discussion here: https://discourse.nixos.org/t/another-implementation-of-mapattrstolist

Additionally, I searched nixpkgs for expressions equivalent to the old `mapAttrsToList` and replaced them with direct calls to the new implementation.
2025-05-08 13:58:54 +08:00
Wolfgang Walther
c8d2eca963 .editorconfig: move subfolder config into separate .editorconfig files
This avoids paths in the top-level file getting out-of-sync, because the
.editorconfig files would be moved together with the files they target.
2025-05-07 20:01:35 +02:00
Vladimír Čunát
7aeb16e7ff Merge master into staging-next 2025-05-04 08:07:53 +02:00
Jörg Thalheim
211568d4fd lib.systems: add golang platform dialect (#403030) 2025-05-04 06:04:53 +02:00
nixpkgs-ci[bot]
7be7cc17c3 Merge master into staging-next 2025-05-02 18:05:12 +00:00
adisbladis
9338d924db lib.meta.availableOn: Return false if pkg parameter is null
To fix overriding packages that checks for platform compatibility, like pipewire.

`pipewire` contains the following logic to enable support for ldac depending on library platform compatibility:
```nix
ldacbtSupport = lib.meta.availableOn stdenv.hostPlatform ldacbt
```

Which is used later in the expression to create a Meson flag:
```nix
(lib.mesonEnable "bluez5-codec-ldac" (bluezSupport && ldacbtSupport))
```

This means that attempting to build `pipewire` without `ldacbt` like:
```nix
pipewire.override {
  ldacbt = null;
}
```
will fail because the the Meson flag indicates the feature should be enabled, but the library is passed to `buildInputs` as `null`.
2025-05-02 19:01:17 +02:00
aleksana
e1828f9668 lib.systems: add golang platform dialect 2025-04-30 22:05:32 +08:00
K900
19e54b8a69 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-30 07:14:48 +03:00
aleksana
06bb544356 lib.systems.inspect.patterns.isEfi: add loongarch 2025-04-29 22:50:31 +08:00
nixpkgs-ci[bot]
c376a565f9 Merge staging-next into staging 2025-04-24 18:04:57 +00:00