about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-04-14Revert "lib/options: Use escapeNixIdentifier for showOption"Daiderd Jordan1-7/+8
This is used in in the manual generation for option identifiers that can be linked. This, unike what the example describes, doesn't preserve quotes which is needed for these identifiers to be valid. This reverts commit 124cccbe3b63122733e02e41e45a383ec48752fd.
2020-04-14lib/options: Relax showOption quotingJan Tojnar1-1/+14
https://github.com/NixOS/nixpkgs/commit/124cccbe3b63122733e02e41e45a383ec48752fd broke the build of NixOS manual. It does not make sense to be as strict as with attributes since we are not limited by the CLI's inability to handle numbers. Placeholders should not be quoted either as they are not part of Nix syntax but a meta-level construct.
2020-04-13lib/maintainer-list: Implement validity checksSilvan Mosberger2-1/+76
2020-04-13lib/tests/release.nix: Avoid importing nixpkgs into the storeSilvan Mosberger1-3/+3
Improves build time by about a factor of two on my system
2020-04-13lib/tests/modules.sh: Don't depend on $PWDSilvan Mosberger1-1/+4
2020-04-13lib/options: Use escapeNixIdentifier for showOptionSilvan Mosberger1-8/+1
2020-04-13lib/strings: Introduce escapeNixIdentifierSilvan Mosberger1-0/+15
2020-04-10treewide: Per RFC45, remove all unquoted URLsMichael Reilly1-24/+24
2020-04-05lib: add shortcut for fake SRI hashTony Olagbaiye2-1/+2
2020-04-02Merge pull request #83241 from Infinisil/valid-drv-nameSilvan Mosberger3-2/+76
lib/strings: Add `sanitizeDerivationName` function
2020-04-01kernel: fix config generationMatthieu Coudron1-4/+4
Addresses https://github.com/NixOS/nixpkgs/issues/71803: Kernel options are not merged as described, especially the "optional" aspects. The error silences legitimate warnings.
2020-04-01lib.licenses: Add Unicode License Agreement for Data Files and SoftwareKonrad Borowski1-0/+5
2020-03-30lib/strings: Add sanitizeDerivationName functionSilvan Mosberger3-2/+76
2020-03-26mongodb: 3.4.10 -> 4.0.4Nathan Smyth1-0/+7
fix: Adding libtool to allow darwin compiles Libtool seems to be required for mongodb to compile on darwin. fix: Marking MongoDB as broken on aarch64 fix: Adding libtools to the pkg imports Update mongodb to 4.0.4
2020-03-26Merge pull request #82929 from zimbatm/nixos-gerritzimbatm1-0/+53
nixos gerrit module
2020-03-26lib.generators: add toGitINIzimbatm1-0/+53
This code was taken from the home-manager project.
2020-03-24lib/systems: Add Genode platform definitionsEmery Hemingway5-2/+11
Add platform definitions for 64-bit ARM and x86. This is sufficient for for building Genode where a toolchain is provided as an overlay. Toolchain: git+https://git.sr.ht/~ehmry/genodepkgs?rev=14fc773ac9ecd2cbb30cb4612b284eee83d83546
2020-03-24Merge pull request #83201 from michaelpj/imp/sources-unnamedRobert Hensing1-5/+2
cleanSourceWith: don't use baseNameOf
2020-03-23cleanSourceWith: don't use baseNameOfMichael Peyton Jones1-5/+2
Currently, not providing `name` to `cleanSourceWith` will use the name of the imported directory. However, a common case is for this to be the top level of some repository. In that case, the name will be the name of the checkout on the current machine, which is not necessarily reproducible across different settings, and can lead to e.g. cache misses in CI. This is documented in the comment on `cleanSourceWith`, but this does not stop it being a subtle trap for users. There are different tradeoffs in each case: 1. If `cleanSourceWith` defaults to `"source"`, then we may end up with a user not knowing what directory a source store path corresponds to. However, it being called "unnamed" may give them a clue that there is a way for them to name it, and lead them to the definition of the function, which has a clear `name` parameter. 2. If `cleanSoureWith` defaults to the directory name, then a user may face occasional loss of caching, which is hard to notice, and hard to track down. Tracking it down likely requires use of more advanced tools like `nix-diff`, and reading the source of a lot of nix code. I think the downside of the status quo is worse. This is really another iteration of https://github.com/NixOS/nix/issues/1305: that led to adding the `name` argument in the first place, this just makes us use a better default `name`.
2020-03-19Merge pull request #82882 from obsidiansystems/armv6-embeddedJohn Ericson2-2/+8
Misc fixes for armv6 bare metal cross
2020-03-19Merge pull request #82897 from Infinisil/fix-recursive-visible-docsRobert Hensing1-1/+1
lib/options: Only recurse into visible sub options
2020-03-19lib/tests: Check for nested option-dependent definitionsSilvan Mosberger4-0/+42
2020-03-19Revert "lib/modules: Throw better error when definitions assign to an option ↵Silvan Mosberger3-9/+1
set" This reverts commit 15c873b486347e7861c64fb0b5a7852be9fc82e4. This was causing infinite recursion when depending on nested options
2020-03-19lib/options: Only recurse into visible sub optionsSilvan Mosberger1-1/+1
2020-03-18lib: Fix systems test for new `armv6l-none`John Ericson1-1/+1
2020-03-18Merge pull request #82751 from Infinisil/minor-module-improvementsRobert Hensing3-6/+22
Minor module improvements
2020-03-18lib/modules: Fix type checks not being done before mergingSilvan Mosberger2-4/+7
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2020-03-18lib/modules: Throw better error when definitions assign to an option setSilvan Mosberger3-1/+10
2020-03-17lib/modules: Test the ability for config to depend on options for compatibilityRobert Hensing2-0/+21
2020-03-17lib/modules: Remove internal _module attribute from configSilvan Mosberger1-1/+5
The _module option is added as an internal option set, and it messes up the results of module evaluations, requiring people to manually filter _modules out. If people depend on this, they can still use config._module from inside the modules, exposing _module as an explicitly declared user option. Or alternatively with the _module attribute now returned by evalModules.
2020-03-12Merge pull request #70157 from teto/lib_kernelSilvan Mosberger2-6/+14
Add lib.kernel
2020-03-12lib: Add armv6l-none to doubles listJohn Ericson1-1/+7
2020-03-12Merge #81713: lib.callPackages(With): guard against a repeated mistakeVladimír Čunát1-1/+6
2020-03-12lib.callPackages(With): guard against a repeated mistakeVladimír Čunát1-1/+6
For example see the parent commit.
2020-03-12lib/systems: Assume newlib when no kernel and no libc is providedMatthew Bauer1-2/+1
newlib is the default for most tools when no kernel is provided. Other exist, but this seems like a safe default. (cherry picked from commit 8009c2071179ee3490f244b91a49202728efe403)
2020-03-10Merge pull request #72125 from jtojnar/maintainer-groupsJan Tojnar1-0/+1
lib: Add lib.maintainer-groups
2020-03-10lib/generators: Add toINI option for duplicate keysSilvan Mosberger2-6/+24
2020-03-05Merge pull request #80919 from hercules-ci/modules-add-file-contextRobert Hensing1-1/+1
lib/modules.nix: Add file context to unmerged values in mergeDefinitions
2020-03-01Merge pull request #68491 from roberth/fix-dontRecurseIntoAttrsRobert Hensing2-1/+16
Fix dontRecurseIntoAttrs + add to lib + doc
2020-02-24lib/modules.nix: Add file context to unmerged values in mergeDefinitionsRobert Hensing1-1/+1
This helps with troubleshooting exceptions in config values, which were hard to track down for options with many definitions. The trace will look like: error: while evaluating the attribute 'config.foo' at undefined position: [...] while evaluating the option `foo': [...] while evaluating definitions from `/home/user/mymod.nix': while evaluating 'dischargeProperties' at /home/user/nixpkgs/lib/modules.nix:464:25, called from /home/user/nixpkgs/lib/modules.nix:392:137: while evaluating the attribute 'value' at /home/user/nixpkgs/lib/modules.nix:277:44: Value error! where the `/home/user/mymod.nix` module is { lib, ... }: { options.foo = lib.mkOption { type = lib.types.lines; }; config.foo = builtins.throw "Value error!"; }
2020-02-22Merge pull request #80814 from matthewbauer/default-newlib-for-noneJohn Ericson1-2/+1
lib/systems: Assume newlib when no kernel and no libc is provided
2020-02-22lib/systems: Assume newlib when no kernel and no libc is providedMatthew Bauer1-2/+1
newlib is the default for most tools when no kernel is provided. Other exist, but this seems like a safe default.
2020-02-1020.09 is Nightingaleworldofpeace1-1/+1
2020-02-10Merge pull request #68897 from edolstra/masterEelco Dolstra2-2/+2
Flake support
2020-02-10lib/tests/misc.nix: Don't make a copy on NixpkgsEelco Dolstra1-1/+1
2020-02-10lib/tests/misc.nix: Fix dependency on currentSystemEelco Dolstra1-1/+1
This doesn't work in pure mode.
2020-02-08Merge pull request #79291 from chkno/remove-isArmworldofpeace2-4/+1
Remove isArm
2020-02-05stdenv: Remove isArm (use isAarch32 instead)Chuck1-3/+0
isArm has been deprecated for three releases. All references have been removed. Tree-wide substitution was performed in #37401 21 months ago.
2020-02-05lib.systems.elaborate: isArm -> isAarch32Chuck1-1/+1
This is the last reference to isArm. isArm is deprecated after 18.03. This substitution was performed tree-wide in #37401.
2020-02-05Revert "Revert "Merge master into staging-next""Frederik Rietdijk1-1/+1
In 87a19e9048773d5a363679617406ad148d36c3b8 I merged staging-next into master using the GitHub gui as intended. In ac241fb7a570d6cf81d229ad22a8889602639160 I merged master into staging-next for the next staging cycle, however, I accidentally pushed it to master. Thinking this may cause trouble, I reverted it in 0be87c79797a5fa384fbc356c74ed54f9f7829ea. This was however wrong, as it "removed" master. This reverts commit 0be87c79797a5fa384fbc356c74ed54f9f7829ea.