summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* Merge master into staging-nextgithub-actions[bot]2021-04-15
|\
| * lib.systems.examples.amd64-netbsd: add warningAlyssa Ross2021-04-15
| | | | | | | | Otherwise, nobody will know it's deprecated!
* | Merge master into staging-nextgithub-actions[bot]2021-04-15
|\|
| * lib: Adjust NetBSD example systemsJohn Ericson2021-04-15
| | | | | | | | Deprecate the odd one so no breaking change.
* | Merge remote-tracking branch 'upstream/staging-next' into down-integrate-stagingLuke Granger-Brown2021-04-12
|\|
| * Merge pull request #116495 from r-burns/ppc64Sandro2021-04-12
| |\ | | | | | | lib/systems: remove powerpc64 elfv1 support
| | * lib/systems: remove powerpc64 elfv1 supportRyan Burns2021-03-15
| | | | | | | | | | | | | | | I was specifying the ELF ABI using -elfv1 and -elfv2 target config suffixes, which are nonstandard and no longer work with gnu-config.
| * | systems: add appropriate rustc.config for androidMilan Pässler2021-04-09
| | | | | | | | | | | | Rust doesn't like the `-unknown` vendor component in the target triple.
* | | Merge pull request #111988 from thefloweringash/darwin-platform-versionsJohn Ericson2021-04-12
|\ \ \ | | | | | | | | Darwin platform versions
| * | | lib.systems: add darwinPlatform where necessaryAndrew Childs2021-04-11
| | | |
| * | | bintools-wrapper, cc-wrapper: parameterize darwin min version variableAndrew Childs2021-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These variables are the ones that the standard toolchain uses, so we should use those and not always use MACOSX_DEPLOYMENT_TARGET. See https://github.com/tpoechtrager/cctools-port/blob/236a426c1205a3bfcf0dbb2e2faf2296f0a100e5/cctools/ld64/src/ld/PlatformSupport.cpp#L54-L55
| * | | darwin: move deployment target and sdk version to platform configAndrew Childs2021-03-26
| | | |
* | | | lib.licenses: add bsdOriginalUC (BSD 4-Clause University of California-Specific)ajs1242021-04-09
| |/ / |/| |
* | | lib.trivial: fix typo "nixpks" -> "nixpkgs"Alyssa Ross2021-04-05
| | |
* | | lib/generators: add toDhallEmery Hemingway2021-04-01
| | |
* | | lib: fix commitIdFromGitRepo (#117752)Léo Gaspard2021-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When in the presence of worktrees, it happens that /commondir has a trailing slash. In these circumstances, it can lead to `lib.pathType` being passed paths like `/foo/bar/.git/`, which in turn lead to `error: attribute '.git' missing`. With this change, we now make sure send properly-formatted paths to all other functions. This, in particular, fixes running NixOS tests on worktrees created by libgit2 on my machine. (Worktrees created by git itself appear to not hit the issue.)
* | | Merge pull request #115919 from Ma27/module-error-improvementSilvan Mosberger2021-03-26
|\ \ \ | |/ / |/| | lib/modules: better error message if an attr-set of options is expected
| * | lib/modules: better error message if an attr-set of options is expectedMaximilian Bosch2021-03-11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently wrote some Nix code where I wrongly set a value to an option which wasn't an actual option, but an attr-set of options. The mistake I made can be demonstrated with an expression like this: { foo = { lib, pkgs, config, ... }: with lib; { options.foo.bar.baz = mkOption { type = types.str; }; config.foo.bar = 23; }; } While it wasn't too hard to find the cause of the mistake for me, it was necessary to have some practice in reading stack traces from the module system since the eval-error I got was not very helpful: error: --- TypeError --------------------------------------------------------- nix-build at: (323:25) in file: /nix/store/3nm31brdz95pj8gch5gms6xwqh0xx55c-source/lib/modules.nix 322| foldl' (acc: module: 323| acc // (mapAttrs (n: v: | ^ 324| (acc.${n} or []) ++ f module v value is an integer while a set was expected (use '--show-trace' to show detailed location information) I figured that such an error can be fairly confusing for someone who's new to NixOS, so I decided to catch this case in th `byName` function in `lib/modules.nix` by checking if the value to map through is an actual attr-set. If not, a different error will be thrown.
* | Merge pull request #113212 from lopsided98/kernel-arm-fixJohn Ericson2021-03-21
|\ \ | | | | | | lib/systems/platforms: remove TI_CPTS override
| * | lib/systems/platforms: remove TI_CPTS overrideBen Wolsieffer2021-02-15
| | | | | | | | | | | | | | | | | | Forcing the module to be builtin breaks 5.10, which wants to compile it as a module (probably due to dependencies). There doesn't seem to be a need to have it builtin anymore, so we can just remove the override.
| * | lib/systems/platforms: note that RPi 3 fixes aren't needed for kernel >=4.17Ben Wolsieffer2021-02-15
| | |
* | | Merge branch 'master' into staging-nextJan Tojnar2021-03-18
|\ \ \
| * | | licenses.odbl: init at 1.0Aaron Andersen2021-03-17
| | |/ | |/|
* / | lib/systems: add `darwinArch`Andrew Childs2021-03-02
|/ /
* / lib/licenses: fix regression removing shortName for some licensessternenseemann2021-02-25
|/ | | | | | | | | | | | | Usually we ensure using the mapAttrs call wrapping the license set that every license has an associated shortName. A change related to legacy aliases most likely introduced the removal of the shortName attribute for all the legacy license names by splitting the set into two sets connected by a record update operator -- leading to mapAttrs only affecting the first set. Since it used to be a valid assumption to have that every license had a shortName attribute, we reintroduce this attribute for the legacy aliases as well.
* Merge pull request #112885 from alyssais/wiktionaryMichael Raskin2021-02-12
|\ | | | | dictdDBs.wiktionary: 20161001 -> 20210201; refactor
| * lib.licenses.fdl11Plus: initAlyssa Ross2021-02-11
| |
* | lib: fix typo in platforms.nixPhilipp Adolf2021-02-11
|/ | | | | | | In 9c213398b312e0f0bb9cdf05090fd20223a82ad0 kernelPreferBuiltin was moved/renamed to linux-kernel.preferBuiltin. However, for armv7l-hf-multiplatform the new option was written with an uppercase P, which made the kernel build process ignore it.
* lib: remove mention of flashplayer in docsBernardo Meurer2021-02-08
|
* lib.licenses: add bsd1 (BSD 1-Clause License)Fabian Affolter2021-02-02
|
* Revert "lib/generators: fix toPretty throwing on (partially applied) builtins"sternenseemann2021-02-01
| | | | | | | | | | | | | | | This reverts commit d9a7d03da8c58aa863911506ae3153729f8931da. Reason for this is that it actually doesn't migitate the issue on nix stable for another reason: builtins.tryEval doesn't prevent the error generated by builtins.functionArgs from halting evaluation: > builtins.tryEval (builtins.functionArgs builtins.functionArgs) error: 'functionArgs' requires a function, at (string):1:19 Thus it seems that there is no workaround to make lib.generators.toPretty work with nix stable and primops since there is no way to distinguish between primops and lambdas in nix.
* Merge pull request #111469 from sternenseemann/topretty-fix-curryingSilvan Mosberger2021-01-31
|\ | | | | lib/generators: fix toPretty throwing on (partially applied) builtins
| * lib/generators: fix toPretty throwing on (partially applied) builtinssternenseemann2021-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An high level example case of this problem occuring can be found below: nix-repl> lib.generators.toPretty {} (lib.concatStringsSep "\n") error: 'functionArgs' requires a function, at /home/lukas/src/nix/nixpkgs/lib/trivial.nix:334:42 However this does not happen on other partially applied functions: nix-repl> lib.generators.toPretty {} (lib.concatMapStringsSep "\n") "<function>" The issue, as it turns out is that while builtins are functions, builtins.functionArgs throws if is passed a builtin or a partially applied builtin: nix-repl> lib.generators.toPretty {} builtins.toString error: 'functionArgs' requires a function, at /home/lukas/src/nix/nixpkgs/lib/trivial.nix:334:42 nix-repl> lib.generators.toPretty {} (builtins.foldl' (a: b: a + b)) error: 'functionArgs' requires a function, at /home/lukas/src/nix/nixpkgs/lib/trivial.nix:334:42 I'm pretty sure this qualifies as a nix bug and should be filed accordingly, but we can work around it in lib.generators.toPretty by using tryEval and falling back to {} which functionArgs _should_ return for builtins. The nix behavior is inconsistent to say the least: nix-repl> builtins.functionArgs builtins.functionArgs error: 'functionArgs' requires a function, at (string):1:1 nix-repl> builtins.typeOf builtins.functionArgs "lambda" builtins.functionArgs (a: 1 + a) { } nix-repl> builtins.typeOf (a: 1 + a) "lambda"
* | lib/types: add description for functionToFritz Otlinghaus2021-01-31
| |
* | Merge pull request #111345 from r-burns/ppc64-big-endianJohn Ericson2021-01-30
|\ \ | | | | | | Enable PPC64 (big-endian)
| * | lib.systems: add powerpc64-linuxRyan Burns2021-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PPC64 supports two ABIs: ELF v1 and v2. ELFv1 is historically what GCC and most packages expect, but this is changing because musl outright does not work with ELFv1. So any distro which uses musl must use ELFv2. Many other platforms are moving to ELFv2 too, such as FreeBSD (as of v13) and Gentoo (as of late 2020). Since we use musl extensively, let's default to ELFv2. Nix gives us the power to specify this declaratively for the entire system, so ELFv1 is not dropped entirely. It can be specified explicitly in the target config, e.g. "powerpc64-unknown-linux-elfv1". Otherwise the default is "powerpc64-unknown-linux-elfv2". For musl, "powerpc64-unknown-linux-musl" must use elfv2 internally to function.
* | | Merge pull request #110787 from tfc/cartesian-productSilvan Mosberger2021-01-29
|\ \ \ | |_|/ |/| | lib/attrsets: add cartesianProductOfSets function
| * | Deprecate lib.crossListsJacek Galowicz2021-01-28
| | |
| * | lib/attrsets: add cartesianProductOfSets functionJacek Galowicz2021-01-28
| | |
* | | gcc: fix armhf targetAlexander Foremny2021-01-29
|/ / | | | | | | Fixes #96921
* | Merge pull request #110707 from Infinisil/functionToRobert Hensing2021-01-27
|\ \ | |/ |/| Bring back `types.functionTo`
| * lib/tests: More functionTo testsSilvan Mosberger2021-01-27
| |
| * lib/types: Improved functionTo mergingSilvan Mosberger2021-01-27
| | | | | | | | | | | | | | Now type checks the resulting function values and allows mkMerge and co. Also indicates that the type check is done in the function body Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
| * lib/tests/modules: add a test for the functionTo typeBas van Dijk2021-01-24
| | | | | | | | (cherry picked from commit 478af112e83df806bd8a51174834d2a130fbdeb9)
| * Revert "Remove types.functionTo."Bas van Dijk2021-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4ff1ab5a56f1280d2de319ad4eb4b2796e07ed35. We need this to type options like: services.xserver.windowManager.xmonad.extraPackages that specify functions that take an attribute set containing packages / plugins and return a list containing a selection of the values in this set. The reason we need a dedicated type for this is to have the correct merge behaviour. Without the functionTo type merging multiple function option definitions results in an evaluation error. The functionTo type merges definitions by returning a new function that applies the functions of all the definitions to the given input and merges the result. (cherry picked from commit 7ed41ff5e7e633dd64866398ee497ac02736a3a5)
* | lib/systems: fix linuxArch for power + riscvRyan Burns2021-01-25
| | | | | | | | | | | | | | | | | | | | | | Looks like these got left behind in the kernelArch -> linuxArch migration. Fixes: * pkgsCross.powernv.linuxHeaders * pkgsCross.riscv64.linuxHeaders * pkgsCross.riscv32.linuxHeaders and dependees
* | Merge pull request #110672 from Profpatsch/lib-add-traceFnSeqNSilvan Mosberger2021-01-25
|\ \ | |/ |/| lib/debug: add traceFnSeqN
| * lib/debug: add traceFnSeqNProfpatsch2021-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Immensely helpful when you want to see the changes a function makes to its value as it passes through. Example: ``` $ nix-instantiate --strict --eval -E '(with import ./lib; traceFnSeqN 2 "id" (x: x) { a.b.c = 3; })' trace: { fn = "id"; from = { a = { b = {…}; }; }; to = { a = { b = {…}; }; }; } { a = { b = { c = 3; }; }; } ```
* | treewide: fix double quoted strings in meta.descriptionvolth2021-01-24
| | | | | | | | Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
* | Merge pull request #100687 from spease/add-newer-xcode-hashesMatthew Bauer2021-01-23
|\ \ | | | | | | darwin: update xcode versions