aboutsummaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: Create `makeScopeWithSplicing`John Ericson2020-11-192-1/+28
| | | | | It's ugly as hell, but I suppose it is needed to codify how to make spliced package sets.
* Merge master into staging-nextFrederik Rietdijk2020-11-168-19/+64
|\
| * Merge pull request #102766 from siraben/mmixJohn Ericson2020-11-145-16/+32
| |\ | | | | | | Initial implementation of cross-compilation to Knuth's MMIX
| | * Initial implementation of mmix cross-compileBen Siraphob2020-11-095-16/+32
| | |
| * | lib: Add composeManyExtensionsJoe Hermaszewski2020-11-133-3/+32
| | |
* | | Merge staging-next into stagingFrederik Rietdijk2020-11-111-2/+6
|\| |
| * | Merge pull request #44928 from vcunat/p/configure-assertEelco Dolstra2020-11-111-2/+6
| |\ \ | | | | | | | | lib/strings: guard against an easy mistake
| | * | lib/strings: guard against an easy mistakeVladimír Čunát2018-08-121-2/+6
| | | | | | | | | | | | | | | | | | | | This would catch the bad `fwknop` flags fixed in 580cab57e4, during evaluation already.
* | | | Initial support for OpenRISC 1000 (or1k)Samuel Dionne-Riel2020-11-094-0/+11
|/ / /
* | / lib/sources.nix: fix incorrect inheritV2020-10-301-1/+1
| |/ |/| | | | | | | | | | | split comes from builtins, not lib. error: attribute 'split' missing, at /nix/path/nixpkgs/lib/sources.nix:4:4 (use '--show-trace' to show detailed location information)
* | lib/types.nix: fix missing inheritKeshav Kini2020-10-261-0/+3
| | | | | | | | | | | | | | I think there was a silent (i.e. semantic) merge conflict between PR #101139 and PR #100456. This commit should fix the error, which manifests as follows: error: undefined variable 'boolToString' at /home/kkini/src/nixpkgs/lib/types.nix:552:42
* | Merge pull request #101139 from roberth/lib-use-static-scope-checkingRobert Hensing2020-10-269-86/+265
|\ \ | | | | | | lib: Use Nix's static scope checking, fix error message, optimize
| * | lib/sources.nix: Prefer lib for readFile inheritRobert Hensing2020-10-221-1/+1
| | |
| * | lib: Add lib.trace for consistencyRobert Hensing2020-10-221-1/+1
| | | | | | | | | | | | This puts it among the trace* family of functions derived from it.
| * | lib/modules: Simplify inheritsRobert Hensing2020-10-221-34/+32
| | |
| * | lib: Add lib.isFloat for consistencyRobert Hensing2020-10-221-1/+1
| | | | | | | | | | | | | | | Unlike the other three is* functions in lib.trivial, it was only available as lib.trivial.isFloat
| * | lib/options.nix: Use merge-friendly inherit syntaxRobert Hensing2020-10-221-5/+30
| | |
| * | lib: Use Nix's static scope checking, fix error message, optimizeRobert Hensing2020-10-229-82/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nix can perform static scope checking, but whenever code is inside a `with` expression, the analysis breaks down, because it can't know statically what's in the attribute set whose attributes were brought into scope. In those cases, Nix has to assume that everything works out. Except it doesnt. Removing `with` from lib/ revealed an undefined variable in an error message. If that doesn't convince you that we're better off without `with`, I can tell you that this PR results in a 3% evaluation performance improvement because Nix can look up local variables by index. This adds up with applications like the module system. Furthermore, removing `with` makes the binding site of each variable obvious, which helps with comprehension.
| * | lib/types.nix: Use // instead of mergeAttrsRobert Hensing2020-10-221-1/+1
| | |
| * | lib/options.nix: Use head instead of elemAt _ 0Robert Hensing2020-10-221-1/+1
| | |
* | | Merge pull request #101409 from rycee/dbus-warningGabriel Ebner2020-10-251-1/+1
|\ \ \
| * | | docs: update documentation of `mkRemovedOptionModule`Robert Helgesson2020-10-241-1/+1
| |/ / | | | | | | | | | | | | Since b08b0bcbbec77046e5a7082177cedc12fbf1dc6c, the function actually causes an assertion error, not a warning.
* | | Merge pull request #100456 from maralorn/boolToStringAndreas Rammhold2020-10-251-1/+1
|\ \ \ | |/ / |/| | treewide: De-inline uses of lib.boolToString
| * | treewide: De-inline uses of lib.boolToStringMalte Brandy2020-10-141-1/+1
| | | | | | | | | | | | This commit should not change eval results
* | | Merge pull request #100953 from AtnNn/splitStringsSilvan Mosberger2020-10-202-21/+28
|\ \ \ | | | | | | | | Implement splitString using builtins.split
| * | | lib.splitString: use builtin.splitEtienne Laurin2020-10-182-21/+28
| |/ /
* | | lib: Add readTree function to filesystemFarid Zakaria2020-10-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a friendly function to easily return a flattened list of files within a directory. This is useful if you want to easily iterate or concatSep the list of files all found within a directory. (i.e. when constructing Java's CLASSPATH) Style improvements Co-authored-by: Silvan Mosberger <github@infinisil.com>
* | | Merge branch 'master' into staging-nextVladimír Čunát2020-10-103-1/+24
|\| | | | | | | | | | | | | | | | | | | | Quite many rebuilds from master: > Estimating rebuild amount by counting changed Hydra jobs. > 3926 x86_64-darwin > 4645 x86_64-linux
| * | Merge pull request #96641 from zimbatm/data-module-importszimbatm2020-10-093-1/+24
| |\ \ | | | | | | | | nixos: Data module imports
| | * | lib: allow to import JSON and TOML fileszimbatm2020-09-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vision here is that configuration tools can generate .json or .toml files, which can be plugged into an existing configuration. Eg: { lib, ... }: { imports = [ (lib.modules.importJSON ./hardware-configuration.json) ]; }
| | * | lib: add importTOMLzimbatm2020-09-122-1/+7
| | | | | | | | | | | | | | | | | | | | Complements the `lib.importJSON`. `builtins.readTOML` has been introduced in Nix 2.1.
* | | | Merge staging-next into stagingFrederik Rietdijk2020-10-061-0/+1
|\| | |
| * | | lib/types: Fix type description of bool enum valuesSilvan Mosberger2020-10-031-0/+1
| | | | | | | | | | | | | | | | Previously bool values would show as <bool>
* | | | Merge branch 'staging-next' into stagingJan Tojnar2020-09-244-33/+55
|\| | |
| * | | lib/tests: Update for error message changesSilvan Mosberger2020-09-211-12/+12
| | | |
| * | | lib/tests: Allow grepping for newlines in error messagesSilvan Mosberger2020-09-211-1/+1
| | | |
| * | | lib/modules: Evaluate single defs for readOnly errorSilvan Mosberger2020-09-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | If multiple definitions are passed, this evaluates them all as if they were the only one, for a better error message. In particular this won't show module-internal properties like `_type = "override"` and co.
| * | | lib/modules: Improve error messages using showDefsSilvan Mosberger2020-09-212-10/+10
| | | |
| * | | lib/options: Introduce showDefsSilvan Mosberger2020-09-211-0/+18
| | | | | | | | | | | | | | | | For pretty-printing definitions, including file and values
| * | | lib/types: Remove unreachable if branchSilvan Mosberger2020-09-211-10/+8
| | | | | | | | | | | | | | | | | | | | The type's check function already ensured that it can't be passed non-lists
* | | | Merge staging-next into stagingFrederik Rietdijk2020-09-2211-27/+310
|\| | |
| * | | Merge pull request #97133 from Infinisil/improved-toPrettySilvan Mosberger2020-09-212-27/+104
| |\ \ \ | | | | | | | | | | Improve `generators.toPretty`
| | * | | lib/generators.toPretty: functors should print as functionsSilvan Mosberger2020-09-171-7/+7
| | | | | | | | | | | | | | | | | | | | Not attribute sets. So move the function case forward
| | * | | lib/generators.toPretty: Print [] and {} compactlySilvan Mosberger2020-09-172-2/+9
| | | | |
| | * | | lib/generators.toPretty: Switch away from δ and λSilvan Mosberger2020-09-172-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - These symbols can be confusing for those not familiar with them - There's no harm in making these more obvious - Terminals may not print them correctly either Also changes the function argument printing slightly to be more obvious
| | * | | lib/generators.toPretty: Improved string printing, handling newlinesSilvan Mosberger2020-09-172-1/+40
| | | | |
| | * | | lib/generators.toPretty: Implement multiline printingSilvan Mosberger2020-09-172-11/+40
| | | | |
| | * | | lib/generators.toPretty: Wrap in a go functionSilvan Mosberger2020-09-171-3/+4
| | | | | | | | | | | | | | | | | | | | As a preparation to the following commit
| | * | | lib/generators.toPretty: Only quote attribute names if necessarySilvan Mosberger2020-09-172-2/+2
| | | | |
| * | | | Merge pull request #97119 from Infinisil/types.anythingRobert Hensing2020-09-219-0/+206
| |\ \ \ \ | | | | | | | | | | | | Introduce `types.anything`