about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-08-19lib.systems.inspect.patterns.isGnu: initAlyssa Ross1-0/+1
This allows checking e.g. stdenv.hostPlatform.isGnu, just like isMusl or isUClibc. It was already possible to check for glibc with stdenv.hostPlatform.libc == "glibc", but when that doesn't line up with how every other platform check works, this is apparently sufficiently non-obvious that we've ended up with stuff like adding glibc.static if !isMusl, which is obviously wrong.
2021-08-18lib/systems: fix scaleway-c1 platformRyan Burns1-1/+1
This regressed in 9c213398b312e0f0bb9cdf05090fd20223a82ad0 The recursiveUpdate gave the platform both gcc.cpu and gcc.arch attrs instead of only gcc.cpu. This is invalid; gcc configuration fails with: ``` Switch "--with-arch" may not be used with switch "--with-cpu" ``` So we revert to using `//` to retain only gcc.cpu (which is more specific than the processor arch).
2021-08-18lib: inherit mkImageMediaOverridelassulus1-1/+1
2021-08-17Merge pull request #132583 from ↵Lassulus1-0/+1
blaggacao/fix/soft-force-the-file-system-layout-for-boot-media nixos/boot-media: soft-force entire fs layout
2021-08-15treewide: runCommandNoCC -> runCommandRobert Hensing2-3/+3
This has been synonymous for ~5y.
2021-08-14Fix import path.Victor Borja1-1/+1
Trying to create a simple flake with input: ``` { inputs.nixpkgs-lib.url = "github:NixOS/nixpkgs?dir=lib"; outputs = {nixpkgs-lib, ...}: { }; } ``` Fails when trying to evaluate the nixpkgs-lib flake with an error like: ``` error: getting status of '/nix/store/xxxx-source/lib/lib': No such file or directory (use '--show-trace' to show detailed location information) ```
2021-08-13Merge pull request #133508 from Infinisil/toPretty-no-drvPathRobert Hensing1-1/+1
lib.generators: Handle no drvPath in toPretty
2021-08-11Merge pull request #130862 from Atemu/licenses-redistributable-attrKevin Cox1-140/+158
lib.licenses: cleanup, consistency and redistributable attribute
2021-08-11lib.licenses: mark a few unfree redistributable licenses as suchAtemu1-0/+6
I'm sure there are more but it's not feasible for a single person to check all of them
2021-08-11lib.licenses: introduce `redistributable` attributeAtemu1-0/+2
Allows for distinction of licenses that are unfree overall but do grant the right to redistribute. Defaults to the freeness of the license. Note: Many unfree but are redistributable licenses aren't marked as such. I expect that to be fixed in a distributed manner over time. Closes https://github.com/NixOS/nixpkgs/pull/97789
2021-08-11lib.licenses: make all licenses have `free` and `deprecated` attrsAtemu1-1/+3
This makes them consistent which eases more complex operations on licenses such as filtering etc.
2021-08-11lib.licenses: refactor common attribute applicationAtemu1-140/+148
This is cleaner and makes common attribute application more expandable
2021-08-11lib.generators: Handle no drvPath in toPrettySilvan Mosberger1-1/+1
Previously, if a derivation without a `drvPath` was handled, an error would be thrown: nix-repl> lib.generators.toPretty {} { type = "derivation"; } error: attribute 'drvPath' missing, at /home/infinisil/src/nixpkgs/lib/generators.nix:251:24 With this commit it doesn't anymore: nix-repl> lib.generators.toPretty {} { type = "derivation"; } "<derivation ???>" This matches what `nix repl` outputs: nix-repl> { type = "derivation"; } «derivation ???»
2021-08-10lib/options: Better mergeEqualOption error for uncomparable typesSilvan Mosberger1-1/+2
For an option definition that uses `lib.options.mergeEqualOption` underneath, like `types.anything`, an error is thrown when multiple functions are assigned, indicating that functions can't be compared for equivalence: error: The option `test' has conflicting definition values: - In `xxx': <function> - In `xxx': <function> (use '--show-trace' to show detailed location information) However, the error message didn't use the correct files. While above error indicates that both definitions are in the xxx file, that's in fact not true. Above error was generated with options.test = lib.mkOption { type = lib.types.anything; }; imports = [ { _file = "yyy"; test = y: y; } { _file = "xxx"; test = x: x; } ]; With this change, the error uses the correct file locations: error: The option `test' has conflicting definition values: - In `xxx': <function> - In `yyy': <function> (use '--show-trace' to show detailed location information)
2021-08-03lib/modules: add mkImageMediaOverrideDavid Arnold1-0/+1
so the underlaying use case of the preceding commit is so generic, that we gain a lot in reasoning to give it an appropriate name. As the comment states: image media needs to override host config short of mkForce
2021-08-04Merge pull request #131267 from blaggacao/fix-functionArgsSilvan Mosberger2-1/+14
lib: fix functionArgs for functors
2021-08-03lib: fix functionArgs for functorsDavid Arnold2-1/+14
`functionArgs` should give valid results on functions that have been identified with `lib.isFunction` instead of erroring out.
2021-08-01lib.systems: add m68k-netbsd supportAlyssa Ross3-6/+7
m68k was recently added for Linux and none, but NetBSD also supports m68k. Nothing will build yet, but I want to make sure we at least encode the existence of NetBSD support for every applicable architecture we support for other operating systems.
2021-08-01lib.systems.doubles: re-sortAlyssa Ross1-6/+6
These were alphabetically sorted until m68k and s390 were added.
2021-07-30lib/systems/platforms: armv7l-hf-multiplatform: fix kernel buildBen Wolsieffer1-0/+6
autoModules triggers a build system bug where ks8851_mll needs to be built-in if ks8851 is also built-in.
2021-07-27Merge pull request #110742 from siraben/deprecate-foldBen Siraphob3-10/+10
2021-07-25Initial implementation of s390 cross-compileBen Siraphob5-3/+11
2021-07-24Merge pull request #131310 from siraben/m86k-crossJohn Ericson5-2/+11
Initial implementation of m68k cross-compile
2021-07-24Initial implementation of m68k cross-compileBen Siraphob5-2/+11
2021-07-23Merge pull request #128032 from Artturin/add-swap-optionsRobert Hensing1-0/+7
nixos/swap: add options option
2021-07-20lib/types.nix: add nonEmptyStrArtturin1-0/+7
2021-07-18Merge pull request #124353 from hercules-ci/small-enum-descriptionRobert Hensing1-1/+11
lib.types.enum: Improve description for lengths 0 and 1
2021-07-12lib.mkFixStrictness: DeprecateRobert Hensing2-4/+2
2021-07-12Partially revert "lib/modules: Drop mkStrict and mkFixStrictness"Robert Hensing2-2/+6
mkFixStrictness was never properly deprecated and should only be removed after warning for some time. This partially reverts commit 8fb9984690c878fcd768e967190957441de05d11.
2021-07-04strings.nix: Fix overly monomorphic type signature commentsNiklas Hambüchen1-2/+2
These functions work on lists of anything, not just lists of strings.
2021-06-28Merge pull request #124875 from hercules-ci/lib-sourcesRobert Hensing3-17/+163
lib.sources: docs, tests, refactoring
2021-06-23Merge master into staging-nextgithub-actions[bot]2-6/+2
2021-06-23Merge pull request #125991 from helsinki-systems/drop/mkStrictSilvan Mosberger2-6/+2
lib/modules: Drop mkStrict and mkFixStrictness
2021-06-22Merge branch 'master' into staging-nextMartin Weinelt1-1/+1
2021-06-20treewide: use quotes for urlPavol Rusnak1-1/+1
2021-06-12mesaPlatforms: Welcome riscv64-linux to the familyZhaofeng Li1-1/+1
2021-06-07Merge pull request #125942 from musfay/rlottietomberek1-0/+5
rlottie: 0.1 -> 0.2
2021-06-06lib/modules: Drop mkStrict and mkFixStrictnessJanne Heß2-6/+2
This was deprecated in 2014 and is not used anywhere in the tree.
2021-06-06lib.systems.parsed: add "elf" for some NetBSD archsAlyssa Ross1-1/+13
In Autoconf, some old NetBSD targets like "i686-unknown-netbsd" are interpreted as a.out, not elf, and virtually nothing supports it. We need to specify e.g. "i686-unknown-netbsdelf" to get the right behaviour.
2021-06-06lib.systems.parse.kernels: fix typo in commentAlyssa Ross1-1/+1
2021-06-06rlottie: 0.1 -> 0.2Mustafa Çalışkan1-0/+5
2021-06-06Merge pull request #82642 from magnetophon/faustPhysicalModelingSandro1-0/+6
2021-06-02Merge pull request #124992 from primeos/android-toolsMichael Weiss1-0/+5
android-tools: init at 31.0.0p1
2021-06-02android-tools: init at 31.0.0p1Michael Weiss1-0/+5
lowPrio is used to avoid collisions with the simg2img package. Licensing information is in share/licenses/android-tools/AOSP_LICENSE.
2021-06-01platforms: Enable ftrace support for RISC-VZhaofeng Li1-1/+0
Support has landed in mainline for a while.
2021-06-01platforms: Build flat kernel image for RISC-VZhaofeng Li1-1/+2
Newer bootloaders for RISC-V (i.e., OpenSBI + U-Boot) support flat and compressed kernel images but not vmlinux. Therefore, let's build "Image" like what we do with aarch64. Also copy DTBs while we are at it.
2021-05-29lib.sources.trace: initRobert Hensing1-0/+26
2021-05-29lib.sources.sourceFilesBySuffices: Improve docRobert Hensing1-5/+17
2021-05-29lib/tests/sources.sh: initRobert Hensing3-0/+64
2021-05-29lib/sources: Internal representation for cleanSourceWithRobert Hensing1-12/+56