summaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Expand)AuthorAgeFilesLines
* Merge staging-next into stagingnixpkgs-ci[bot]2025-08-075-45/+168
|\
| * lib.evalModules: add graph attribute•••Co-authored-by: Ali Jamadi <jamadi1377@gmail.com> Shahar "Dawn" Or2025-08-075-23/+137
| * lib/modules: extract isDisabled from filterModules•••Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com> Ali Jamadi2025-08-071-22/+31
* | Merge remote-tracking branch 'origin/staging-next' into stagingK9002025-08-042-5/+43
|\|
| * lib.modules: Add hint when using `config` in `imports` (#430204)Robert Hensing2025-08-042-5/+43
| |\
| | * lib.modules: Improve infinite recursion hint ••• hsjobeki: Using config in imports is possible in general. But its not possible to do conditional imports where the condition depends on config. Thats two different statements. Co-authored-by: Johannes Kirschbauer <hsjobeki+github@gmail.com>Robert Hensing2025-08-041-1/+1
| | * lib.modules: Adjust error message•••- Lower case error trace for consistency - Be more explicit about the condition under which the hint applies, and the resolution. Robert Hensing2025-08-021-2/+1
| | * lib.modules: Make _module.args evaluation explicit in traceRobert Hensing2025-08-021-1/+7
| | * lib.modules: Generalize the import hint to _module.argsRobert Hensing2025-08-022-13/+5
| | * lib.modules: Test infinite recursion hint•••We don't want it to occur in the trace of any unrelated errors. Robert Hensing2025-08-021-1/+33
| | * lib.modules: Add hint when using `config` in `imports`490162025-08-011-1/+10
* | | Merge staging-next into stagingnixpkgs-ci[bot]2025-08-021-1/+1
|\| |
| * | lib/trivial: update oldestSupportedRelease to 2505•••24.11 is deprecated now Leona Maroni2025-08-011-1/+1
| |/
* | Merge staging-next into stagingnixpkgs-ci[bot]2025-08-013-0/+17
|\|
| * lib.systems: Add examples & helpers for MSVCRoss Smyth2025-07-313-0/+17
* | libx11: refactor, move to pkgs/by-name and rename from xorg.libX11•••refactorial changes: - move `CPP` into `env` - remove `sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure` because it didn't change anything other than the store paths in the resulting derivation (using `diff --recursive` (and `xxd` to diff binary files that changed)) - remove `xorg.buildPackages.libc.static` from `depsBuildBuild` since `xorg.buildPackages` doesn't exist (thus `xorg.buildPackages.libc.static or null` evaluating to `null`). Fixing that to `libc.static` (and moving it to `nativeBuildInputs` (where non-compiler deps belong)) actually broke the static build in a weird way i don't understand. Zitrone2025-07-311-0/+18
* | Merge branch 'staging-next' into stagingWolfgang Walther2025-07-2413-610/+625
|\|
| * treewide: run nixfmt 1.0.0Wolfgang Walther2025-07-2413-567/+582
* | treewide: populate `arch` and `platform` for more node packages (#422938)Philip Taron2025-07-151-0/+45
|\ \ | |/ |/|
| * nodejs: split destCPU into stdenv.$platform.node•••this architecture mapping is used broadly in the node ecosystem. an assortment of tools and hooks, like buildNpmPackage or pnpm.configHook, will benefit from reusing these values. placing them in stdenv makes sense because (1) several of these tools don't currently depend on nodejs, and may even be available where nodejs is not and (2) `stdenv.{build,host,target}Platform` seems to be less error-prone than `pkgs*.nodejs.{os,arch}` -- especially for setup hooks where the offsets are shifted. Colin2025-07-071-0/+45
* | lib.packagesFromDirectoryRecursive: Allow non-"path" `directory`•••As initially designed, `lib.packagesFromDirectoryRecursive` allowed passing a string for the `directory` argument. This is necessary for several reasons: - `outPath` on derivations and Flake inputs is not a path. - Derivations can be coerced to their `outPath` in string interpolation, but that produces strings, not paths. - `builtins.path`, bizarrely, returns a string instead of a path (not that the documentation makes this clear). If a path is used instead of a string here, then Nix will dutifully copy the entire directory into a new path in the Nix store (ignored as WONTFIX by Eelco in https://github.com/NixOS/nix/issues/9428). For industrial use cases, this can result in an extra 10-15 seconds on every single eval just to copy files from one spot in the Nix store to another spot in the Nix store. In #361424, this was changed so that `directory` must be a path, breaking these use-cases. I'm not really sure what happened here -- #361424 has very little justification for why it exists, only a reference to a previous version of the PR (#359941), which itself had very little justification given. The description on #359941 explained that it would "Shrink the function's code by ~2/3rd 🎉", but 60% of the reduction in size was just deleting comments (!) and bindings like `directoryEntryIsPackage` that helped clarify the intent of the implementation. As a result, the new implementation is (to my eyes) more challenging to read and understand. I think the whole thing was in service of #392800, which adds a `newScope` argument in order "to create nested scopes for each (sub)directory (not just the top-level one) when `newScope` is given." Nobody noticed this regression until after the commit was merged. After @phanirithvij pointed out the regression, @nbraud said they would "shortly prepare a PR to fix this" [1] but did not. Later, they would explain that they were "quite ill the last month(s)" [2], which explains why this got forgotten about. @nbraud also requested a review from @Gabriella439 [3], as she had reviewed the original PR adding `lib.packagesFromDirectoryRecursive`, but not from me, the original author of that PR. @Gabriella439 did not review the "refactor" PR, and no attempt to contact her or myself was made after that initial request. This behavior is admittedly rather subtle, so I'm not sure either Gabriella or myself would have noticed the change (especially since the relevant PR restructures the entire implementation). While I find this a bit frustrating, I should have added a test for this use-case in my original PR; if there was a test that relied on passing paths in as a string, perhaps the authors modifying this code would have noticed that the implementation was not an accident. [1]: https://github.com/NixOS/nixpkgs/pull/361424#discussion_r1912407693 [2]: https://github.com/NixOS/nixpkgs/pull/359984#issuecomment-2775768808 [3]: https://github.com/NixOS/nixpkgs/pull/361424#issuecomment-2521308983 Rebecca Turner2025-07-102-3/+30
* | lib/sources: add jj to clean source (#423613)Sandro2025-07-091-1/+3
|\ \ | |/ |/|
| * lib/sources: add jj to clean sourceWill Fancher2025-07-081-1/+3
* | lib.systems.examples: Add rust.rustcTarget for ppc64-elfv1OPNA26082025-07-051-0/+1
* | doc: fix example consistency on `mapAttrsRecursiveCond` (#418991)Johannes Kirschbauer2025-07-041-1/+1
|\ \
| * | doc: fix example consistency on `mapAttrsRecursiveCond`•••The example should take a two argument function `f`. Léana 江2025-06-221-1/+1
* | | lib.filesystem.resolveDefaultNix: init (#418824)Johannes Kirschbauer2025-07-033-1/+89
|\ \ \
| * | | lib.callPackageWith: Use resolveDefaultNix•••Tested with: 1. Replace the callPackageWith call by `null`, to simulate an ancient Nix 2. Run the following commands in a terminal in nixpkgs: $ mkdir test/ $ echo '{ asdfasdfasdf }: null' >test/default.nix $ nix repl -f . nix-repl> callPackage ./test { } error: … while calling the 'abort' builtin at /home/user/src/nixpkgs/lib/customisation.nix:312:7: 311| else 312| abort "lib.customisation.callPackageWith: ${error}"; | ^ 313| error: evaluation aborted with the following error message: 'lib.customisation.callPackageWith: Function called without required argument "asdfasdfasdf" at /home/user/src/nixpkgs/test/default.nix' Robert Hensing2025-06-211-1/+1
| * | | lib.filesystem.resolveDefaultNix: initRobert Hensing2025-06-212-0/+88
| |/ /
* | | fetchedMavenDeps: support proxy and custom cacerts (#420608)Philip Taron2025-06-301-2/+2
|\ \ \
| * | | lib/fetchers: remove unused importsFlorian Klink2025-06-271-2/+2
* | | | nixVersions.nix_2_3: add knownVulnerabilitiesAlyssa Ross2025-06-301-3/+10
* | | | **/README.md: one sentence per line•••As documented in doc/README.md. Wolfgang Walther2025-06-293-22/+46
|/ / /
* | | lib.systems.inspect.patterns: init isAbiElfv1OPNA26082025-06-261-0/+5
* | | lib.types.attrTag: expose suboptions at correct levelsodiboo2025-06-222-7/+2
|/ /
* | lib.systems.examples: Split glibc powerpc64 back into 2 ABI options•••ELFv1 is the historically better supported one on glibc, ELFv2 seems to have some issues with our toolchain. Restore the option to pick the ABI with pkgsCross. OPNA26082025-06-211-1/+5
* | modules: Add `_prefix` module argument, improve error, add docs (#398839)Johannes Kirschbauer2025-06-194-3/+49
|\ \
| * | lib.modules: Add prefix to imports type check errorRobert Hensing2025-04-153-1/+25
| * | lib.modules: TyposRobert Hensing2025-04-151-2/+3
| * | lib.modules: Add _prefix module argumentRobert Hensing2025-04-153-0/+21
* | | lib.derivations: avoid common double-warn with warnOnInstantiate (#414606)Johannes Kirschbauer2025-06-191-2/+4
|\ \ \
| * | | lib.derivations: avoid common double-warn with warnOnInstantiate•••Before: $ nix-build . -A opensycl trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' /nix/store/8g0lfv82s0sprmqgfj146ggkb7bn3rm6-adaptivecpp-25.02.0 $ nix-instantiate . -A opensycl trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' warning: you did not specify '--add-root'; the result might be removed by the garbage collector /nix/store/b8q5xp94s4n7zfn7as5a9xjvylh6y3pi-adaptivecpp-25.02.0.drv After: $ nix-build . -A opensycl trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' /nix/store/8g0lfv82s0sprmqgfj146ggkb7bn3rm6-adaptivecpp-25.02.0 $ nix-instantiate . -A opensycl trace: evaluation warning: 'opensycl' has been renamed to 'adaptivecpp' warning: you did not specify '--add-root'; the result might be removed by the garbage collector /nix/store/b8q5xp94s4n7zfn7as5a9xjvylh6y3pi-adaptivecpp-25.02.0.drv Peder Bergebakken Sundt2025-06-071-2/+4
* | | | Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2025-06-113-2/+105
|\ \ \ \ | | |_|/ | |/| |
| * | | 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
* | | | | Merge master into staging-nextnixpkgs-ci[bot]2025-06-101-2/+2
|\| | | |
| * | | | lib.mkEnableOption: fix syntax error in example commentFlorent Charpentier2025-06-101-2/+2
| | |/ / | |/| |
* | | | xorgproto: refactor and move to pkgs/by-name from xorg namespaceZitrone2025-06-061-0/+12
* | | | Merge master into staging-nextnixpkgs-ci[bot]2025-06-024-6/+12
|\| | |