aboutsummaryrefslogtreecommitdiff
path: root/lib (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-12-05lib/string: drop redundant string in description of toInt.Alex Brandt1-1/+1
Describing the string argument as a string is redundant and not needed to describe what this function does.
2020-12-04lib/strings: fix typo in exampleAlex Brandt1-2/+2
The example refers to a snake_case function name but Nix uses camelCase function names. This ensures the example is correct for the given function.
2020-12-03lib/strings: fix examples for enableFeatureAsAlex Brandt1-2/+2
The As was missing in the examples on this library function. This will ensure the examples refer to the function they document.
2020-11-29Cross-compiling configuration for reMarkable 2 tabletTad Fisher2-0/+20
2020-11-29lib/systems/exmaple: `riscv-multiplatform` no longer needs parameterJohn Ericson2-4/+4
2020-11-29lib, binutils: Move Risc-V bfdEmulation to be by the othersJohn Ericson1-1/+0
2020-11-29lib.systems.platforms: Make selection more flexibleJohn Ericson2-14/+19
We dont have to match on exact strings if we get accessed to `parsed`. Co-authored-by: Matthew Bauer <mjbauer95@gmail.com>
2020-11-24lib.lists.unique: Switch from recursive function to using a foldadisbladis1-7/+1
This improves performance by ~30-40% for smaller test cases and makes larger cases where my laptop would OOM pass in seconds.
2020-11-23Initial implementation of remarkable1 cross-compileBen Siraphob2-0/+19
2020-11-19lib: Create `makeScopeWithSplicing`John Ericson2-1/+28
It's ugly as hell, but I suppose it is needed to codify how to make spliced package sets.
2020-11-15licenses: add HPND-sell-variantJonathan Strickland1-0/+5
2020-11-13lib: Add composeManyExtensionsJoe Hermaszewski3-3/+32
2020-11-09Initial support for OpenRISC 1000 (or1k)Samuel Dionne-Riel4-0/+11
2020-11-09Initial implementation of mmix cross-compileBen Siraphob5-16/+32
2020-10-30lib/sources.nix: fix incorrect inheritV1-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)
2020-10-26lib/types.nix: fix missing inheritKeshav Kini1-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
2020-10-24docs: update documentation of `mkRemovedOptionModule`Robert Helgesson1-1/+1
Since b08b0bcbbec77046e5a7082177cedc12fbf1dc6c, the function actually causes an assertion error, not a warning.
2020-10-22lib/sources.nix: Prefer lib for readFile inheritRobert Hensing1-1/+1
2020-10-22lib: Add lib.trace for consistencyRobert Hensing1-1/+1
This puts it among the trace* family of functions derived from it.
2020-10-22lib/modules: Simplify inheritsRobert Hensing1-34/+32
2020-10-22lib: Add lib.isFloat for consistencyRobert Hensing1-1/+1
Unlike the other three is* functions in lib.trivial, it was only available as lib.trivial.isFloat
2020-10-22lib/options.nix: Use merge-friendly inherit syntaxRobert Hensing1-5/+30
2020-10-22lib: Use Nix's static scope checking, fix error message, optimizeRobert Hensing9-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.
2020-10-22lib/types.nix: Use // instead of mergeAttrsRobert Hensing1-1/+1
2020-10-22lib/options.nix: Use head instead of elemAt _ 0Robert Hensing1-1/+1
2020-10-19lib: Add readTree function to filesystemFarid Zakaria1-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>
2020-10-18lib.splitString: use builtin.splitEtienne Laurin2-21/+28
2020-10-14treewide: De-inline uses of lib.boolToStringMalte Brandy1-1/+1
This commit should not change eval results
2020-10-03lib/types: Fix type description of bool enum valuesSilvan Mosberger1-0/+1
Previously bool values would show as <bool>
2020-09-29lib/modules: Make sure to not import module _file's into the storeSilvan Mosberger1-2/+2
Previously if `_file` was specified by a module: trace: warning: The type `types.string' of option `foo' defined in `/nix/store/yxhm2il5yrb92fldgriw0wyqh2kk9qyc-bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types. With this change: trace: warning: The type `types.string' of option `foo' defined in `/home/infinisil/src/nixpkgs/bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
2020-09-21lib/tests: Update for error message changesSilvan Mosberger1-12/+12
2020-09-21lib/tests: Allow grepping for newlines in error messagesSilvan Mosberger1-1/+1
2020-09-21lib/modules: Evaluate single defs for readOnly errorSilvan Mosberger1-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.
2020-09-21lib/modules: Improve error messages using showDefsSilvan Mosberger2-10/+10
2020-09-21lib/options: Introduce showDefsSilvan Mosberger1-0/+18
For pretty-printing definitions, including file and values
2020-09-21lib/types: Remove unreachable if branchSilvan Mosberger1-10/+8
The type's check function already ensured that it can't be passed non-lists
2020-09-20platforms: add bigEndian and littleEndianFrancesco Gazzetta1-25/+28
2020-09-17lib/generators.toPretty: functors should print as functionsSilvan Mosberger1-7/+7
Not attribute sets. So move the function case forward
2020-09-17lib/generators.toPretty: Print [] and {} compactlySilvan Mosberger2-2/+9
2020-09-17lib/generators.toPretty: Switch away from δ and λSilvan Mosberger2-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
2020-09-17lib/generators.toPretty: Improved string printing, handling newlinesSilvan Mosberger2-1/+40
2020-09-17lib/generators.toPretty: Implement multiline printingSilvan Mosberger2-11/+40
2020-09-17lib/generators.toPretty: Wrap in a go functionSilvan Mosberger1-3/+4
As a preparation to the following commit
2020-09-17lib/generators.toPretty: Only quote attribute names if necessarySilvan Mosberger2-2/+2
2020-09-15lib/tests: Add tests for types.anythingSilvan Mosberger7-0/+166
2020-09-15lib/types: Introduce types.anythingSilvan Mosberger1-0/+36
This new type has unsurprising merge behavior: Only attribute sets are merged together (recursively), and only if they don't conflict. This is in contrast to the existing types: - types.attrs is problematic because later definitions completely override attributes of earlier definitions, and it doesn't support mkIf and co. - types.unspecified is very similar to types.attrs, but it has smart merging behavior that often doesn't make sense, and it doesn't support all types
2020-09-15lib/options: Fix mergeEqualOption for singular functionsSilvan Mosberger1-0/+4
Previously it would error out for a single function definition
2020-09-12lib.licenses: add Prosperity-3.0.0 license (#97832)Geoffrey Huntley1-0/+6
2020-09-12lib: allow to import JSON and TOML fileszimbatm1-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) ]; }
2020-09-12lib: add importTOMLzimbatm2-1/+7
Complements the `lib.importJSON`. `builtins.readTOML` has been introduced in Nix 2.1.