summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* Merge pull request #67809 from Infinisil/propagate-override-argsSilvan Mosberger2019-10-22
|\ | | | | lib.makeOverridable: Propagate function arguments
| * lib/makeOverridable: RefactorSilvan Mosberger2019-09-05
| | | | | | | | | | | | | | - Rename ff to result because that's what it is - Better indentation - Less parens - Comment what overrideWith does
| * lib/makeOverridable: Remove unimplemented overrideDerivation for functionsSilvan Mosberger2019-09-05
| | | | | | | | | | | | - Apparently nobody ever needed this - We already have enough ways to override things - Using overrideDerivation is discouraged
| * lib/makeOverridable: Propagate function args of the callPackage'd functionSilvan Mosberger2019-09-05
| | | | | | | | | | | | | | This allows querying function arguments of things like fetchFromGitHub: nix-repl> lib.functionArgs pkgs.fetchFromGitHub { fetchSubmodules = true; githubBase = true; ... }
| * lib/makeOverridable: Propagate function arguments to override functionsSilvan Mosberger2019-09-05
| | | | | | | | | | | | | | This allows querying the arguments you can .override: nix-repl> lib.functionArgs pkgs.hello.override { fetchurl = false; stdenv = false; }
| * lib/makeOverridable: Abstract result overridingSilvan Mosberger2019-09-05
| |
| * lib/makeOverridable: Deduplicate override definitionSilvan Mosberger2019-09-05
| | | | | | | | And call it overrideArgs in the let binding because that's what it does
* | lib/trivial: add `pipe` functionProfpatsch2019-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `pipe` is a useful operator for creating pipelines of functions. It works around the usual problem of e.g. string operations becoming deeply nested functions. In principle, there are four different ways this function could be written: pipe val [ f1 .. fn ] pipe val [ fn .. f1 ] compose [ f1 .. fn ] val compose [ fn .. f1 ] val The third and fourth form mirror composition of functions, they would be the same as e.g. `(f1 << f2 << f3 .. << fn) val`. However, it is not clear which direction the list should have (as one can see in the second form, which is the most absurd. In order not to confuse users, we decide for the most “intuitive” form, which mirrors the way unix pipes work (thus the name `pipe`). The flow of data goes from left to right. Co-Authored-By: Silvan Mosberger <infinisil@icloud.com>
* | Merge pull request #69746 from Infinisil/rem-opt-usage-messageSilvan Mosberger2019-10-02
|\ \ | | | | | | lib.mkRemovedOptionModule: Show replacement for option usage too
| * | lib.mkRemovedOptionModule: Show replacement for option usage tooSilvan Mosberger2019-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously mkRemovedOptionModule would only show the replacement instructions when the removed option was *defined*. With this change, it also does so when an option is *used*. This is essential for options that are only intended to be used such as `security.acme.directory`, whose replacement instructions would never trigger without this change because almost everybody only uses the option and isn't defining it.
* | | Merge pull request #70194 from obsidiansystems/lib-more-armMatthew Bauer2019-10-01
|\ \ \ | | | | | | | | lib: Add armv7a-linux to doubles.nix
| * | | lib: Add armv7a-linux to doubles.nixJohn Ericson2019-10-01
| | | | | | | | | | | | | | | | This is needed for android.
* | | | mkRemovedOptionModule: assert on removed options (#69419)Silvan Mosberger2019-09-30
|\ \ \ \ | |_|/ / |/| | | mkRemovedOptionModule: assert on removed options
| * | | mkRemovedOptionModule: assert on removed optionsRobin Gloster2019-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want to ignore config that can mess up machines. In general this should always fail evaluation, as you think you are changing behaviour and don't, which can easily create run-time errors we can catch early.
* | | | Merge pull request #69345 from joachifm/feat/split-versionJoachim F2019-09-27
|\ \ \ \ | |/ / / |/| | | Replace uses of splitString for splitting version strings
| * | | lib: basic tests for lib.versionsJoachim Fasting2019-09-26
| | | |
| * | | lib/versions: expose splitVersionJoachim Fasting2019-09-26
| | | |
* | | | licenses: refer to curl using spdxOrivej Desh2019-09-22
| | | |
* | | | qhull: specify spdx licenseOrivej Desh2019-09-22
|/ / /
* | | lib: fix typo in 'zipAttrsWith' documentationPeter Simons2019-09-11
| | |
* | | 20.03 is MarkhorSamuel Leathers2019-09-09
|/ / | | | | | | | | * Markhor is a spiral horned animal that is on the endangered species list * https://en.wikipedia.org/wiki/Markhor
* | Merge master into staging-nextFrederik Rietdijk2019-09-06
|\ \
| * \ Merge pull request #67996 from roberth/cleanSourceWith-nameSilvan Mosberger2019-09-06
| |\ \ | | | | | | | | lib.cleanSourceWith: Allow name to be set, optional filter, doc
| | * | lib.cleanSourceWith: Allow name to be set, optional filter, docRobert Hensing2019-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is API-compatible and hash-compatible with the previous version. At first I considered to write a rename function too, but adding it name to cleanSourceWith was a no-brainer for ease of use. It turns out that a rename function isn't any more useful than cleanSourceWith. To avoid having to write the identity predicate when renaming, the filter is now optional. builtins.path is supported since Nix 2.0 which is required by nixpkgs
| * | | Fix typo in lists.nixRobert Hensing2019-09-06
| |/ /
* | | Merge branch 'master' into stagingVladimír Čunát2019-09-02
|\| |
| * | Fix typo in customisation.nixGabriel Féron2019-09-02
| | |
| * | Merge remote-tracking branch 'upstream/master' into js-unknown-ghcjsJohn Ericson2019-09-02
| |\ \
| | * \ Merge lib sort into feature/js-unknown-ghcjsJohn Ericson2019-09-02
| | |\ \
| | * \ \ Merge remote-tracking branch 'upstream/master' into feature/js-unknown-ghcjsJohn Ericson2019-09-02
| | |\ \ \
| | | * | | lib/types: Make usage of types.string emit a warningSilvan Mosberger2019-08-31
| | | | |/ | | | |/|
| * | | | lib: Further clean up systems listJohn Ericson2019-09-02
| | |_|/ | |/| |
| * | | lib: Sort platform predicatesJohn Ericson2019-09-02
| |/ /
| * | Add support for `js-unknown-ghcjs`Moritz Angermann2019-09-02
| | | | | | | | | | | | This adds enough logic to nixpkgs to support the `js-unknown-ghcjs` triple.
* | | Merge staging-next into stagingFrederik Rietdijk2019-08-31
|\ \ \ | | |/ | |/|
| * | Merge pull request #66407 from Infinisil/fix-option-renameSilvan Mosberger2019-08-27
| |\ \ | | | | | | | | lib/modules: Use options `apply` function even if no values are defined
| | * | lib/modules: Use options `apply` function even if no values are definedSilvan Mosberger2019-08-10
| | | | | | | | | | | | | | | | | | | | | | | | This allows `apply` functions to return a valid value if they completely ignore their argument, which is the case for the option renaming functions like `mkAliasOptionModule`. Therefore this solves issue #63693
* | | | treewide: remove redundant recvolth2019-08-28
| | | |
* | | | Merge staging-next into stagingFrederik Rietdijk2019-08-28
|\| | |
| * | | lib/options: fix path in commentJan Tojnar2019-08-26
| | | |
| * | | Merge branch 'master' into flip-map-foreachdanbst2019-08-18
| |\ \ \
| * | | | and one more placedanbst2019-08-05
| | | | |
| * | | | Merge branch 'master' into flip-map-foreachDanylo Hlynskyi2019-08-05
| |\ \ \ \ | | | |/ / | | |/| |
| * | | | rename foreach -> forEachdanbst2019-08-05
| | | | |
| * | | | lib: introduce `foreach` = flip mapdanbst2019-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main purpose is to bring attention to `flip map`, which improves code readablity. It is useful when ad-hoc anonymous function grows two or more lines in `map` application: ``` map (lcfg: let port = lcfg.port; portStr = if port != defaultPort then ":${toString port}" else ""; scheme = if cfg.enableSSL then "https" else "http"; in "${scheme}://cfg.hostName${portStr}" ) (getListen cfg); ``` Compare this to `foreach`-style: ``` foreach (getListen cfg) (lcfg: let port = lcfg.port; portStr = if port != defaultPort then ":${toString port}" else ""; scheme = if cfg.enableSSL then "https" else "http"; in "${scheme}://cfg.hostName${portStr}" ); ``` This is similar to Haskell's `for` (http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Traversable.html#v:for)
* | | | | treewide: remove redundant quotesvolth2019-08-26
| |_|/ / |/| | |
* | | | Merge pull request #65728 from Infinisil/types-eithersAaron Andersen2019-08-13
|\ \ \ \ | |_|/ / |/| | | lib/types: Add oneOf, extension of either to a list of types
| * | | lib/types: Add oneOf, extension of either to a list of typesSilvan Mosberger2019-08-06
| | | |
* | | | Merge pull request #65380 from danbst/int-merge-one-optionSilvan Mosberger2019-07-29
|\ \ \ \ | |/ / / |/| | | lib/types: change merge strategy for `str`, `int`, `float`, `path` and `enum`
| * | | lib/types: change merge strategy for `str`, `int`, `float` and `enum`danbst2019-07-25
| |/ / | | | | | | | | | Change to `mergeEqualOption`.