summaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Expand)AuthorAgeFilesLines
* ci/eval: accept `nix` directly•••Previously we were taking nixVersions and this made external use from the Lix repo's CI annoying. We should probably also test other nix versions than stable (i.e. also latest and Lix), but this involves writing GitHub Actions about it and maybe not running it on every single PR. Future work. Jade Lovelace2025-06-101-1/+2
* lib, treewide: introduce `repoRevToName` and use it to cleanup most `fetch*` ...lassulus2025-06-102-1/+103
|\
| * 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. Jan Malakhovski2025-05-312-1/+103
* | lib.mkEnableOption: fix syntax error in example commentFlorent Charpentier2025-06-101-2/+2
* | treewide: fix typos in comments (#413240)Pol Dellaiera2025-06-024-5/+5
|\ \
| * | treewide: fix typosPeder Bergebakken Sundt2025-06-024-5/+5
| |/
* | lib/types: add doc warning to addCheck (#412364)Johannes Kirschbauer2025-06-021-1/+7
|\ \
| * | lib/types: add doc warning to addCheckJohannes Kirschbauer2025-05-301-1/+7
* | | 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. Wolfgang Walther2025-06-023-10/+11
| |/ |/|
* | 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. Alyssa Ross2025-05-301-1/+1
|/
* lib: prefer replaceString over replaceStringsGutyina Gergő2025-05-283-5/+5
* lib/strings: init replaceStringGutyina Gergő2025-05-283-0/+47
* lib.systems.loongarch64-multiplatform: init (#402689)Philip Taron2025-05-271-0/+11
|\
| * lib.systems.loongarch64-multiplatform: initWeijia Wang2025-05-251-0/+11
* | lib.fileset.difference: fix type docsWolfgang Walther2025-05-261-1/+1
|/
* 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 9338d924dbe0c6b93daec3bf435322812fd176fe. Emily2025-05-231-2/+1
* lib.systems: raise minimum loongarch64 feature support (#403201)Aleksana2025-05-233-1/+69
|\
| * lib.systems.examples: separate loongarch64 for desktop and embedded variantsaleksana2025-05-222-1/+24
| * lib.systems.architectures: add loongarch64aleksana2025-05-221-0/+45
* | lib.systems.elaborate.canExecute: handle different gcc.arch (#403549)Aleksana2025-05-232-1/+79
|\ \ | |/ |/|
| * lib.systems.elaborate.canExecute: handle different gcc.archaleksana2025-05-221-1/+15
| * lib.systems.architectures: add hasInferior and canExecute functionaleksana2025-05-221-0/+64
* | treewide: maintainers-list.nix -> maintainer-list.nix (#409585)Simon Hollingshead2025-05-221-1/+1
* | lib.strings: init toCamelCase (#402372)Johannes Kirschbauer2025-05-183-0/+80
|\ \
| * | lib.strings: init toCamelCaseHeitor Augusto2025-05-113-0/+80
* | | lib/.version: Fix version file formattingSigmanificient2025-05-161-1/+1
* | | 25.11 is Xantusia25.11-preLeona Maroni2025-05-162-2/+2
* | | nixos/image/repart: Use own assertions / warnings. (#406940)Arian van Putten2025-05-151-0/+68
|\ \ \
| * | | lib/asserts: Factor out NixOS's toplevel assertion / warning logic.Will Fancher2025-05-141-0/+68
* | | | ipxe: correct licensing information (#390934)Aleksana2025-05-151-0/+5
|\ \ \ \
| * | | | licenses: add gpl2UBDLPlus•••Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net> Fernando Rodrigues2025-05-131-0/+5
| |/ / /
* | | | lib.systems.examples.riscv64-musl: initAlyssa Ross2025-05-151-0/+4
* | | | lib/systems: remove android cruft (#406682)Morgan Jones2025-05-141-15/+3
|\ \ \ \
| * | | | lib/systems: remove android cruft•••These used legacy names for Android SDK and NDK versions, so now we can do away with them. Morgan Jones2025-05-121-15/+3
| |/ / /
* / / / docs: fix typo: `readDir` -> `dirOf`•••The example code here uses `dirOf`, not `readDir`. I assume this was just a silly typo. Jeremy Fleischman2025-05-121-1/+1
|/ / /
* | | lib.modules.importApply: Fix doc typo; `_key` → `key`•••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`. Matt Sturgeon2025-05-081-1/+1
* | | lib: refactor lib.attrsets.{mapAttrs', mapAttrsToList} and mapAttrs'' in the ...Johannes Kirschbauer2025-05-081-2/+2
|\ \ \
| * | | lib: refactor lib.attrsets.{mapAttrs', mapAttrsToList} and mapAttrs'' in the ...•••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. ccicnce1134242025-05-081-2/+2
| | |/ | |/|
* | | .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. Wolfgang Walther2025-05-071-0/+3
* | | Merge master into staging-nextVladimír Čunát2025-05-041-0/+29
|\ \ \
| * \ \ lib.systems: add golang platform dialect (#403030)Jörg Thalheim2025-05-041-0/+29
| |\ \ \
| | * | | lib.systems: add golang platform dialectaleksana2025-04-301-0/+29
| | |/ /
* | | | Merge master into staging-nextnixpkgs-ci[bot]2025-05-021-1/+2
|\| | |
| * | | 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`. adisbladis2025-05-021-1/+2
| |/ /
* | | Merge remote-tracking branch 'origin/master' into staging-nextK9002025-04-301-0/+5
|\| |
| * | lib.systems.inspect.patterns.isEfi: add loongarchaleksana2025-04-291-0/+5
| |/
* | Merge staging-next into stagingnixpkgs-ci[bot]2025-04-243-7/+1
|\|
| * Revert "pkgs/top-level/stage.nix: add pkgsLLVMLibc"•••This reverts commit 41b14024d24bd7488b58d7a252f8f16b194d57f9. zowoq2025-04-243-7/+1
* | font-{alias,util}, gccmakedep, libp{ciacces,threadstub}s: refactor and migrat...jopejoe12025-04-241-0/+20
|\ \ | |/ |/|
| * font-util: refactored, moved to pkgs/by-name and renamed from xorg.fontutilZitrone2025-04-221-0/+15