about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2024-02-09Merge pull request #286117 from alois31/lib-deprecationsSilvan Mosberger5-11/+12
lib: make deprecation warnings consistent
2024-02-05Merge pull request #285612 from hercules-ci/doRename-conditionRobert Hensing6-3/+77
lib.modules.doRename: Add condition parameter
2024-02-05Merge pull request #285353 from sternenseemann/nix-2.3-syntaxSilvan Mosberger2-0/+2
treewide: fix parse errors with Nix 2.3 and related problems
2024-02-03lib: make deprecation warnings consistentAlois Wohlschlager5-11/+12
The deprecation warnings in lib were wildly inconsistent. Different formulations were used in different places for the same meaning. Some warnings used builtins.trace instead of lib.warn, which prevents silencing; one even only had a comment instead. Make everything more uniform.
2024-02-02Merge branch 'optionalDrvAttr'Shea Levy3-2/+46
2024-02-02lib: Add optionalDrvAttr to conditionally set drv attributes.Shea Levy3-2/+46
This allows for adding new, conditionally set, derivation attributes to an existing derivation without changing any output paths in the case where the condition is not met.
2024-02-02lib.modules.doRename: Add condition parameterRobert Hensing6-3/+77
This is to support single-to-multi service migrations, so that the `to` (e.g. `foos.""`) isn't defined unconditionally. See test cases.
2024-02-02Merge pull request #285301 from ibbem/gitTracked-shallowSilvan Mosberger2-1/+31
lib.fileset.gitTracked: Allow clones of shallow repositories
2024-02-01lib.fileset.gitTracked: Allow clones of shallow repositoriesibbem2-1/+31
The only reason shallow clones are not the default in `builtins.fetchGit` is that `revCount` can't be provided when cloning a shallow repository. However, `revCount` isn't used or exposed by `lib.fileset`. Hence, allowing cloning shallow repositories makes `gitTracked` more general without any drawbacks. Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-01-31lib/tests/packages-from-directory: make sure all .nix files parsesternenseemann2-0/+2
It is useful that all (or almost all) .nix files in nixpkgs at least parse since it allows for checking syntax in the repository programmatically without evaluating anything.
2024-01-30Merge pull request #284829 from deemp/masterRobert Hensing3-0/+9
types.nix: fix nonEmptyListOf
2024-01-30feat: add test for nonEmptyListOf submoduleDanila Danko2-0/+8
2024-01-29types.nix: fix nonEmptyListOfDanila Danko1-0/+1
2024-01-29lib/trivial: bump oldestSupportedRelease to 23.11figsoda1-1/+1
2024-01-27licenses: add Creative Commons Attribution 2.0Vincenzo Mantova1-0/+5
2024-01-18lib.system.inspect: add wasm32 to isILP32Adam Joseph1-1/+2
According to the WebAssembly design doc, wasm32 is an ILP32 ABI like x32, mips64n32, and aarch64_ilp32 (Apple Watch). This commits adds it to the predicate. https://github.com/WebAssembly/design/blob/1319968ca53fb5c7e7ea6cc210c7b0ed46566a45/CAndC%2B%2B.md?plain=1#L16
2024-01-12Merge pull request #248220 from infinisil/document-extendsSilvan Mosberger1-23/+136
Improve the documentation of `lib.extends` and how it relates to overlays
2024-01-08Merge pull request #278777 from tweag/fix-evalsSilvan Mosberger1-1/+5
`lib.callPackageWith`: Use abort again instead of throw and fix evaluation errors caused by it
2024-01-07lib.callPackageWith: Use abort, not throwSilvan Mosberger1-1/+5
This reverts f8ea911f7c4e44b167d4b1b51f6d00ebd93e1ed1, see also https://github.com/NixOS/nixpkgs/pull/271123#discussion_r1442134594
2024-01-02lib/systems: add exec format inspection attrsRyan Burns1-0/+3
Most of the time when we do a patchelf conditional on hostPlatform.isLinux, what we really mean is hostPlatform.isElf. Now that we are starting to support BSDs, this is becoming more important.
2023-12-30Merge pull request #276271 from ↵Robert Hensing2-3/+31
hercules-ci/modules-types-description-nonRestrictiveClause lib.types: Improve descriptions of composed types that have commas
2023-12-26lib/licenses: add missing spdxidsjopejoe11-1/+8
2023-12-23lib.types: Improve descriptions of composed types that have commasRobert Hensing2-3/+31
Type: either ints.positive (enum ["auto"]) Before: positive integer, meaning >0 or value "auto" (singular enum) After: positive integer, meaning >0, or value "auto" (singular enum)
2023-12-19Merge pull request #272083 from tweag/lib-contribSilvan Mosberger1-0/+63
lib: Add contribution guidelines
2023-12-19Merge pull request #273893 from tweag/fileset.gitTracked-storeDirSilvan Mosberger3-57/+125
`lib.fileset.gitTracked`: Support out-of-tree builds
2023-12-19Remove --simulate-pure-evalSilvan Mosberger1-36/+18
2023-12-19lib.fileset.gitTracked: Support out-of-tree buildsSilvan Mosberger3-6/+86
2023-12-19Merge pull request #270537 from 9999years/packagesFromDirectorySilvan Mosberger14-1/+205
lib.packagesFromDirectoryRecursive: init
2023-12-19lib.packagesFromDirectoryRecursive: initRebecca Turner14-1/+205
Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>
2023-12-19lib: `modules.sh` should check JSON output for predictabilityRebecca Turner4-17/+24
Currently, the `lib/tests/modules.sh` test checks the output of `nix-instantiate --eval` without `--json`, which outputs an unspecified human-readable format. This patch modifies `modules.sh` to use the `--json` output instead, to be robust against future changes to `nix-instantiate` output.
2023-12-19lib.fileset.fetchGit: RefactoringSilvan Mosberger1-18/+24
2023-12-15lib.generators: made toLua accept derivations tooMatthieu Coudron1-0/+2
While trying to extend generateLuarocksConfig, I had infinite loops caused by toLua considering derivations as attrSets
2023-12-15lib/tests/release.nix: temporary reference to pkgs/test/releaseAdam Joseph1-1/+13
This commit temporarily adds pkgs/test/release to the lib/tests/release.nix test suite, because ofborg already knows about that entry point. We should move the list of test entry points out of ofborg and into a central place in nixpkgs: https://github.com/NixOS/nixpkgs/issues/272591 Once we do that we won't need to have this ugly kludge in an inappropriate place.
2023-12-15treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobsAdam Joseph1-0/+1
2023-12-13Merge pull request #269551 from tejing1/nixos-stub-ldRobert Hensing1-0/+7
nixos/stub-ld: init module
2023-12-13Merge pull request #273704 from adisbladis/lib-getexe-efficiencySilvan Mosberger1-19/+15
lib.getExe: Make more efficient
2023-12-13Merge pull request #274022 from hercules-ci/doc-attrsets-operatorsSilvan Mosberger1-0/+24
lib/attrsets: Document and link Nix language operators
2023-12-13lib/attrsets: Document and link Nix language operatorsRobert Hensing1-0/+24
2023-12-13lib.path.hasStorePathPrefix: initSilvan Mosberger2-1/+110
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-12-13Merge pull request #273664 from tweag/fileset.gitTracked-improvementsSilvan Mosberger3-41/+56
`lib.fileset.gitTracked,gitTrackedWith`: Minor improvements
2023-12-12lib.getExe: Make more efficientadisbladis1-19/+15
2023-12-11lib.fileset.gitTracked: Improve error when passing filesSilvan Mosberger2-0/+8
2023-12-11lib.fileset: Refactor gitTracked and gitTrackedWithSilvan Mosberger2-41/+48
Introduce an internal function for them to share more behavior. This makes future changes easier.
2023-12-11Merge pull request #273473 from adisbladis/lib-isConvertibleToString-static-listSilvan Mosberger1-2/+4
lib.isConvertibleToString: Statically compute types list
2023-12-11Merge pull request #273470 from adisbladis/lib-tohexstring-static-valuesSilvan Mosberger1-16/+14
lib.toHexString: Statically compute hexDigits attrset
2023-12-11Merge pull request #273474 from adisbladis/lib-cmakeOptionType-static-listSilvan Mosberger1-6/+7
lib.cmakeOptionType: Statically compute types list
2023-12-11Merge pull request #273467 from adisbladis/lib-pipe-no-letSilvan Mosberger1-3/+1
lib.pipe: Avoid creating a scope
2023-12-11Merge pull request #273004 from hercules-ci/attrset-path-longest-prefixRobert Hensing2-0/+117
lib.attrsets.longestValidPathPrefix: init
2023-12-11Merge pull request #257100 from Ma27/version-info-libRobert Hensing3-3/+40
flake: fix `lib.trivial.version` when used from a flake
2023-12-11lib.cmakeOptionType: Statically compute types listadisbladis1-6/+7