summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2022-03-21Merge pull request #163451 from hercules-ci/stop-premature-warningsKevin Cox
Stop premature warnings, including `nix.settings` migration
2022-03-21lib.mkRenamedOptionModuleWith: Remove warnWhenReadRobert Hensing
Let's keep things simple and not poke holes in the improved migration process.
2022-03-19Merge pull request #147077 from Infinisil/updateAttrPathsRobert Hensing
Introduce `lib.updateManyAttrsByPath`
2022-03-18lib.attrsets: Introduce updateManyAttrsByPathSilvan Mosberger
2022-03-18lib.lists: Use builtins.groupBy for lib.groupBySilvan Mosberger
builtins.groupBy is much more performant. It was introduced in https://github.com/NixOS/nix/pull/5715
2022-03-18lib.attrsets: Introduce showAttrPathSilvan Mosberger
2022-03-17Merge pull request #161158 from a-m-joseph/mips64el-support-first-stepsJohn Ericson
mips64el support
2022-03-16Merge pull request #162271 from Infinisil/warn-no-typeRobert Hensing
Throw an error for options without a type
2022-03-16Merge pull request #156533 from ↵Silvan Mosberger
hercules-ci/issue-146882-transparent-submodule-options lib.modules: Let module declare options directly in bare submodule
2022-03-11Merge pull request #163127 from hercules-ci/optimize-optionSet-compatRobert Hensing
lib/modules.nix: Optimize optionSet legacy compat code
2022-03-11Merge pull request #163443 from ncfavier/fix-types-packageRobert Hensing
lib.types.package: only call toDerivation when necessary
2022-03-11lib.types.package: only call toDerivation when necessaryNaïm Favier
The current logic assumes that everything that isn't a derivation is a store path, but it can also be something that's *coercible* to a store path, like a flake input. Unnecessary uses of `lib.toDerivation` result in errors in pure evaluation mode when `builtins.storePath` is disabled. Also document what a `package` is.
2022-03-10Ericson2314's suggestion here: ↵Adam Joseph
https://github.com/NixOS/nixpkgs/pull/161158#discussion_r822295406
2022-03-10This commit adds only comments to platforms.nix.Adam Joseph
2022-03-10comment: explain why gnuabi64 has a rustc.config but gnuabin32 does not.Adam Joseph
2022-03-10remove float = "hard" from mips entriesAdam Joseph
2022-03-10https://github.com/NixOS/nixpkgs/pull/161158#pullrequestreview-903824553Adam Joseph
2022-03-10lib/systems: add mips64el definitionsAdam Joseph
MIPS has a large space of {architecture,abi,endianness}; this commit adds all of them to lib/systems/platforms.nix so we can be done with it. Currently lib/systems/inspect.nix has a single "isMips" predicate, which is a bit ambiguous now that we will have both mips32 and mips64 support, with the latter having two ABIs. Let's add four new predicates (isMips32, isMips64, isMips64n32, and isMips64n64) and treat the now-ambiguous isMips as deprecated in favor of the more-specific predicates. These predicates are used mainly for enabling/disabling target-specific workarounds, and it is extremely rare that a platform-specific workaround is needed, and both mips32 and mips64 need exactly the same workaround. The separate predicates (isMips64n32 and isMips64n64) for ABI distinctions are, unfortunately, useful. Boost's user-scheduled threading (used by nix) does does not currently supports mips64n32, which is a very desirable ABI on routers since they rarely have more than 2**32 bytes of DRAM.
2022-03-10lib.types.optionType: Only merge when necessaryRobert Hensing
2022-03-09lib.isDerivation: SimplifyRobert Hensing
2022-03-09lib: Add mkRenamedOptionModuleWithRobert Hensing
Adds support for sinceRelease
2022-03-07lib/systems: Fix uclibc float-abi being flippedLevi Wright
uclibceabihf and uclibceabi's float hardness was flipped, which causes many headaches
2022-03-07lib/modules.nix: Add comment about internal shorthand null valueRobert Hensing
2022-03-07lib/tests/modules: Add test case for duplicate option error file locationRobert Hensing
2022-03-07lib/modules.nix: Move comment to the actual legacy codeRobert Hensing
2022-03-07lib/modules.nix: Optimize optionSet legacy compat codeRobert Hensing
It's still in the hot path.
2022-03-07Revert "lib.modules: Remove redundant fixupOptionType in option injection"Robert Hensing
This reverts commit 6b077c47ff14cb9a4a8f5cb8986fa83ff626c732. Thanks Infinisil for discovering this problem: > After a lot of trial and error, trying to prove why fixupOptionType should > be used here or not, I figured it out: It's needed for the sake of file > locations in error messages.
2022-03-03lib.modules: Inline a private functionRobert Hensing
This should save about four calls per module.
2022-03-03lib.modules: Default shorthandOnlyDefinesConfig to true when nullRobert Hensing
2022-03-03lib.modules: Remove redundant fixupOptionType in option injectionRobert Hensing
2022-03-03lib.modules: Make option injection work when shorthandOnlyDefinesConfigRobert Hensing
2022-03-03lib.modules: Improve option-is-prefix error messageRobert Hensing
2022-03-03lib.modules: Explain why options can only be merged into submodulesRobert Hensing
2022-03-03lib.modules: Refactor option scanning slightlyRobert Hensing
This scans the options with fewer function calls, improving performance. It also removes a let Env from the happy flow of the new logic.
2022-03-03lib.types.submodule: Remove redundant isSubmodule attrRobert Hensing
2022-03-03lib.modules: Let module declare options directly in bare submoduleRobert Hensing
... where a bare submodule is an option that has a type like `submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`. This makes migration unnecessary when introducing a freeform type in an existing option tree. Closes #146882
2022-03-02Merge pull request #162283 from Infinisil/functionTo.descriptionSilvan Mosberger
lib/types: Fix functionTo description
2022-03-02Merge pull request #149689 from Infinisil/types-typeSilvan Mosberger
Introduce `types.optionType` and use it for `freeformType`
2022-03-01lib.modules: Use types.optionType for _module.freeformTypeSilvan Mosberger
This ensures that the module file locations are propagated to the freeform type, which makes it so that submodules in freeform types now have their declaration location shown in the manual, fixing https://github.com/NixOS/nixpkgs/issues/132085. In addition, this also newly allows freeformTypes to be declared multiple times and all declarations being merged together according to normal option merging. This also removes some awkwardness regarding the type of `freeformType`
2022-03-01lib.types: Introduce `types.optionType`Silvan Mosberger
This type correctly merges multiple option types together while also annotating them with file information. In a future commit this will be used for `_module.freeformType`
2022-03-01lib/types: Fix functionTo descriptionSilvan Mosberger
2022-02-28lib/options: Throw error for options without a typeJanne Heß
Makes all options rendered in the manual throw an error if they don't have a type specified. This is a follow-up to #76184 Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2022-02-28Merge pull request #157301 from pennae/lib-add-mkPackageOption0x4A6F
lib: add mkPackageOption to default.nix
2022-02-22lib/modules: Use types.raw for _module.argsSilvan Mosberger
Fixes https://github.com/NixOS/nixpkgs/issues/53458, as types.raw doesn't allow setting multiple values
2022-02-22lib/types: Introduce types.raw for unprocessed valuesSilvan Mosberger
2022-02-17lib/tests: Add tests for emptyValueSilvan Mosberger
2022-02-17lib/types: Fix emptyValue of listOf and nonEmptyListOfSilvan Mosberger
An empty list is [], not {}! Also, non-empty lists shouldn't have a default of an empty list!
2022-02-16Merge pull request #155707 from 06kellyjac/fehRenaud
feh: correct license
2022-02-10Merge remote-tracking branch 'origin/master' into staging-nextJonathan Ringer
Conflicts: pkgs/top-level/aliases.nix
2022-02-10fix: typo in lib/attrsets.nixJohn Rinehart