3
0
Fork 0
forked from mirrors/nixpkgs
Commit graph

3421 commits

Author SHA1 Message Date
Mykola Orliuk 4ec4c6fda9 lib/generators: add toLua/mkLuaInline
Suitable to simplify Lua-based configurations like neovim-lspconfig that
might need to interpolate Nix package paths.
2023-04-23 01:07:58 +02:00
Artturin 06e8d82e9c lib/systems: disable docs in qemu-user
45M -> 31M
2023-04-22 00:38:56 +03:00
zimbatm ad0b21fbbc
lib: add missing removeAttrs builtin
I'm expecting all the builtins.* functions to be available in lib.*
2023-04-19 21:27:38 +02:00
Silvan Mosberger c701a4dd29 lib.sources.pathType and co.: Move to lib.filesystem
These functions only work with the filesystem, they don't import
anything as sources
2023-04-05 17:18:10 +02:00
Silvan Mosberger 4f35a58184
Merge pull request #221204 from tweag/deprecate-paths-to-strings
lib.strings: Prevent paths as inputs in some functions
2023-04-04 18:35:06 +02:00
Naïm Favier 0d5c1ac149
Merge pull request #222516 from ncfavier/options-better-error
lib/modules: better error for invalid option declarations
2023-04-04 10:42:14 +02:00
Mario Rodas c937feb1a1
Merge pull request #219826 from noctarius/master
Fixed TimescaleDB License Information
2023-04-01 09:19:04 -05:00
Emil "AngryAnt" Johansen e932e98437
lib.toPlist: keep test output in external files for their tab indents 2023-03-27 19:25:52 +02:00
Emil "AngryAnt" Johansen 63a8c43d09
lib.toPlist: basic test coverage 2023-03-27 19:25:38 +02:00
Emil "AngryAnt" Johansen 03ceb367b7
lib.toPlist: support for path values 2023-03-27 16:25:25 +02:00
Cole Helbling d9f767600f lib/customisation: callPackageWith should abort with errors
ofborg relies on the behavior that existed prior to
1c00bf3948, where evaluation would
immediately abort due to a missing argument (whether it be an aliased
package when `allowAliases = false;` or a typo'd or otherwise
nonexistent package).

If `callPackageWith` `throw`s instead of `abort`s, the following
`nix-env` invocation does not fail fast but instead silently skips the
attribute (assuming there is a package that has an aliased package in
its `autoArgs`):

    $ nix-env -qa --json --file . --arg config '{ allowAliases = false; }' &>/dev/null
    $ echo $?
    0

This does change the error output when there is a missing package (for
any of the reasons mentioned above), though. Before this change, the
errors looked like this:

    $ nix-build -A hello --arg config '{ allowAliases = false; }'
    error:
           … while calling the 'throw' builtin

             at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65:

              178|
              179|     in if missingArgs == [] then makeOverridable f allArgs else throw error;
                 |                                                                 ^
              180|

           error: Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"?

And the errors now look like this:

    $ nix-build -A hello --arg config '{ allowAliases = false; }'
    error:
           … while calling the 'abort' builtin

             at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65:

              178|
              179|     in if missingArgs == [] then makeOverridable f allArgs else abort error;
                 |                                                                 ^
              180|

           error: evaluation aborted with the following error message: 'Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"?'
2023-03-24 14:22:11 -07:00
Christoph Engelbert (noctarius) 4f7f469c82
timescaledb: Fixed the licensing for the timescaledb package to be split into TSL (Timescale Community License) and Apache 2.0 components.
TimescaleDB provides two types of licenses, Apache 2.0 and Timescale Community License (TSL), with different feature sets. While all the code is in the same repository, the build
system can build both versions depending on the build parameters set in.

Co-authored-by: Emily Lange <git@indeednotjames.com>
2023-03-24 11:12:12 +01:00
Naïm Favier 8751764236
lib/modules: better error for invalid option declarations
Make `byName` aware of whether it's processing options or config to give
slightly more accurate error messages.
2023-03-22 12:37:28 +01:00
Bernardo Meurer 6e55733359
Merge pull request #219747 from Stunkymonkey/deprecate-isNull 2023-03-16 11:10:22 -03:00
Silvan Mosberger 61012f6daf lib.strings.remove{Prefix,Suffix}: Deprecate for path prefix/suffix arguments
See also parent commits
2023-03-15 19:51:38 +01:00
Silvan Mosberger 5e8b9de728 lib.strings.normalizePath: Deprecate for path values
There's no need to call this function on path data types, and it's
confusing with the new lib.path library functions
2023-03-15 19:42:45 +01:00
Silvan Mosberger 99bc90e301 lib.strings: Deprecate path prefix/suffix/infix arguments
lib.{hasPrefix,hasInfix,hasSuffix} would otherwise return an
always-false result, which can be very unexpected:

    nix-repl> lib.strings.hasPrefix ./lib ./lib/meta.nix
    false
2023-03-15 19:42:43 +01:00
Silvan Mosberger b611afeb74
Merge pull request #209099 from infinisil/lib.path.subpath.join
lib.path.subpath.join: init
2023-03-14 20:47:47 +01:00
sternenseemann 755c177ff9
Merge pull request #219027 from NixOS/haskell-updates
haskellPackages: update stackage and hackage; haskellPackages.ghc: 9.2.6 -> 9.2.7
2023-03-13 11:36:33 +01:00
hsjobeki 15a8d05ba5 init: lib.foldlAttrs
- provide comprehensive example
- add unit test
2023-03-11 10:42:00 +01:00
github-actions[bot] bf7ad8aa57
Merge master into haskell-updates 2023-03-10 00:14:11 +00:00
Alyssa Ross bc7d355dc0 lib.systems: don't try to emulate s390-linux
We don't have an emulator that can do this.
2023-03-09 19:25:23 +00:00
Robert Hensing 6b79fe8cdc
Merge pull request #211855 from hercules-ci/lib-modules-disabledModules-module-with-key
lib/modules: Allow an "anonymous" module with key in disabledModules
2023-03-09 16:16:37 +01:00
github-actions[bot] 4bda2ab514
Merge master into haskell-updates 2023-03-09 00:13:40 +00:00
sternenseemann 471b9cab41 haskell.compiler.ghcHEAD: 9.7.20221224 -> 9.7.20230217
- Christmas is over!

- Upstream has changed the name of the target triplet used for the JS
  backend from js-unknown-ghcjs to javascript-unknown-ghcjs, since Cabal
  calls the architecture "javascript":
  6636b67023

  Since the triplet is made up anyways, i.e. autoconf does not support
  it and Rust uses different triplets for its emscripten backends, we'll
  just change it as well.

- Upstream fixed the problem with ar(1) being invoked incorrectly by stage0:
  e987e345c8
2023-03-08 17:12:18 +01:00
Sandro 7f917aebcd
Merge pull request #214941 from OPNA2608/init/katawa-shoujo
katawa-shoujo: init at 1.3.1
2023-03-08 11:13:54 +01:00
pennae 61852b7faa lib: remove deprecated functions
all of these have been deprecated and raising warnings since 18.09. it's
about time we actually made good on "will be removed in the next release".
2023-03-08 03:57:38 +01:00
Atemu 19e81a9269
Merge pull request #211950 from Atemu/armv8-no-more-armv7
lib/systems/parse: stop considering armv8a able to execute armv7l
2023-03-07 19:25:32 +01:00
Felix Buehler d10e69c86b treewide: deprecate isNull
https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull
2023-03-06 22:40:04 +01:00
Sandro 5a695ebb77
Merge pull request #210125 from OPNA2608/fix/pdisk_patchurl 2023-03-05 18:09:01 +01:00
pennae f0e8db002b lib/options: fix mkPackageOption docs
nixdoc takes everything from Type: to Example: as the type, which
misrendered a large part of the docs. it also drops sorely needed spaces
where the type had line breaks, so all has to be on one line (or use
non-standard literal spaces, which is probably worse).

also clarify what the `?` for arguments mean while we're here.
2023-03-05 01:21:46 +01:00
Naïm Favier a342ebe166
lib/strings: hide asciiTable
Since it's an attribute set, the lib function location generating code
tries to generate locations for each of the characters...
2023-03-04 13:20:49 +01:00
Valentin Gagarin 61cf0b2166
Merge pull request #219235 from patwid/strings-escape-query-for-url-encoding 2023-03-04 12:38:57 +01:00
Patrick Widmer 7089294f10 strings: add escapeQuery for url encoding 2023-03-03 20:48:55 +01:00
Robert Hensing 118bdf25a6 lib/modules: Allow an "anonymous" module with key in disabledModules
This makes the following work

    disabledModules = [ foo.nixosModules.bar ];

even if `bar` is not a path, but rather a module such as

    { key = "/path/to/foo#nixosModules.bar"; config = ...; }

By supporting this, the user will often be able to use the same syntax
for both importing and disabling a module. This is becoming more relevant
because flakes promote the use of attributes to reference modules. Not
all of these modules in flake attributes will be identifiable, but with
the help of a framework such as flake-parts, these attributes can be
guaranteed to be identifiable (by outPath + attribute path).
2023-03-01 15:03:44 +01:00
github-actions[bot] 399e2c78d4
Merge master into staging-next 2023-02-26 06:01:09 +00:00
Anselm Schüler 9769e90233 lib/options: Add more options to mkPackageOption 2023-02-26 03:00:22 +01:00
github-actions[bot] 4688cd53b6
Merge master into staging-next 2023-02-23 18:01:15 +00:00
Alyssa Ross 7ce8e7c4cf lib.licenses.asl20-llvm: replace llvm-exception
LLVM-exception only makes sense when used with the Apache 2.0 license,
so let's combine them, so it's not possible to forget one of them like
happened with llvm_15.
2023-02-23 17:42:15 +00:00
github-actions[bot] 390b789c39
Merge master into staging-next 2023-02-23 12:01:07 +00:00
hsjobeki 09ee6241b5 improves: comprehensiveness 2023-02-23 11:24:47 +01:00
hsjobeki 70c36dcfb8 add better documentation comments to lib.runTests 2023-02-23 10:21:58 +01:00
github-actions[bot] fd8dd0c966
Merge master into staging-next 2023-02-21 18:01:08 +00:00
Naïm Favier f77c364def
Merge pull request #216983 from ncfavier/showOption-comment
lib/options: update showOption comment
2023-02-21 16:31:07 +01:00
Naïm Favier 6c7d4d4f9d
lib/options: update showOption comment 2023-02-18 18:13:11 +01:00
github-actions[bot] bf5abe92d4
Merge master into staging-next 2023-02-15 18:01:14 +00:00
Sandro d05e6727a2
Merge pull request #203539 from SuperSandro2000/architectures-expand-inferiors
lib/systems/architectures: expand inferiors
2023-02-15 16:27:00 +01:00
Silvan Mosberger 1a2c2846b0 lib.path.subpath.join: init
This function can be used to safely join subpaths together
2023-02-13 14:01:17 +01:00
github-actions[bot] 0417b0e54f
Merge staging-next into staging 2023-02-10 00:03:00 +00:00
Domen Kožar 844a738b1f
Merge pull request #215455 from domenkozar/module-errors
nixos: Improve module conflict error messages
2023-02-10 02:42:28 +07:00
OPNA2608 235d9e2187 lib/licenses.nix: Add cc-by-nc-nd-30 2023-02-09 15:50:20 +01:00
Domen Kožar fe734efc9c types: suggest how to resolve the conflict 2023-02-09 08:24:12 +00:00
Domen Kožar b3cc29c288 types: explicitly state unique options are expected to be unique 2023-02-09 07:25:50 +00:00
github-actions[bot] 371c2a6303
Merge staging-next into staging 2023-02-07 18:02:15 +00:00
markuskowa 5cf138823d
Merge pull request #214930 from sheepforce/nwchem
nwchem: init at 7.0.2
2023-02-07 17:30:02 +01:00
Silvan Mosberger a770c0393c
Merge pull request #208887 from tweag/lib.path.append
lib.path.append: init
2023-02-07 17:27:37 +01:00
Phillip Seeber acb812207f lib/licenses: add ecl20 2023-02-07 10:39:46 +01:00
github-actions[bot] 99cce0e1f1
Merge staging-next into staging 2023-02-07 06:02:00 +00:00
Silvan Mosberger 0a60663e67
Merge pull request #206611 from h7x4/lib-lists-add-repeat
lib.lists: add `replicate`
2023-02-07 06:16:09 +01:00
github-actions[bot] d3648def80
Merge staging-next into staging 2023-02-07 00:02:46 +00:00
Bernardo Meurer 7b7b6c248c
Merge pull request #214856 from vamega/bencode-py 2023-02-06 15:58:58 -05:00
h7x4 7c4abbf80e
lib.lists: add replicate
`replicate` returns n copies of an element as a list.

Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2023-02-06 20:40:47 +01:00
Varun Madiath dedb550ce6 bencode-py: init at 4.0.0 2023-02-06 12:14:15 -05:00
Artturi dcc7df7fe6
Merge pull request #211685 from Artturin/splicingstuff1-split 2023-02-03 12:49:08 +02:00
Silvan Mosberger 50e4dbf35b
Merge pull request #205557 from ncfavier/concatLines
lib/strings: add `concatLines`
2023-01-31 18:05:53 +01:00
Silvan Mosberger 96d4702261
Merge pull request #213650 from urandom2/libdoc
lib: standardise attrset type syntax
2023-01-31 16:20:56 +01:00
github-actions[bot] dd1ff149da
Merge master into staging-next 2023-01-31 00:02:31 +00:00
Colin Arnott 6ff66fcbd7
lib: standardise attrset type syntax
There are a number of different syntaxes used for attrset type
signatures in our doc strings, this change standardises upon one that
uses :: for specifying attribute type, and ; terminators to be
consistent with nix syntax. There are no bugs in the functions
themselves, just that different syntaxes may confuse new users.
2023-01-30 23:53:44 +00:00
Florian Klink 31931ffc35
Merge pull request #212939 from amjoseph-nixpkgs/pr/isStatic
meta: replace predicates with pattern over elaborated platform
2023-01-30 21:13:15 +01:00
Alyssa Ross aa51704ba5
lib.systems.inspect.patterns.isEfi: drop ARMv5
I'm not aware of any ARMv5 EFI implementation.  gnu-efi doesn't
support it, so the build of systemd for armv5tel-linux is broken if
it's isEfi.
2023-01-30 19:54:06 +00:00
Robert Hensing 663c41affd
Merge pull request #212282 from hercules-ci/pkg-config-packages
defaultPkgConfigPackages: init
2023-01-30 09:48:53 +01:00
Robert Hensing 473ac9692e lib.hydraJob: Tolerate null
By allowing null, we allow code to avoid filterAttrs, improving
laziness in real world use cases.
Specifically, this strategy prevents infinite recursion errors,
performance issues and possibly other errors that are unrelated to
the user's code.
2023-01-30 00:35:34 +01:00
Alyssa Ross 4f8a5065d7
lib.systems.inspect.patterns.isEfi: remove "aarch64"
There is no "aarch64" CPU family — it counts as "arm", as can be seen
from the definition of isAarch64 above.

Checked that stdenv.hostPlatform.isEfi is still true on aarch64-linux.
2023-01-29 16:29:47 +00:00
Naïm Favier 0288ee587f
maintainers: clarify what fields are required 2023-01-27 18:05:28 +01:00
Naïm Favier 93dc2de29a
maintainers: disallow noreply.github.com emails 2023-01-27 18:05:28 +01:00
Naïm Favier 4e39849611
maintainers: make email optional
Not giving an email address is fine as long as the maintainer is
reachable through other means, such as GitHub or Matrix.
2023-01-27 18:04:20 +01:00
Adam Joseph 9c0a3417c8
Update lib/systems/inspect.nix
Co-authored-by: Naïm Favier <n@monade.li>
2023-01-27 11:56:20 +00:00
Adam Joseph 009a3f1857
Update lib/systems/inspect.nix
Co-authored-by: Naïm Favier <n@monade.li>
2023-01-27 11:16:35 +00:00
Adam Joseph 435618d9b3
Update lib/meta.nix
Co-authored-by: Naïm Favier <n@monade.li>
2023-01-27 11:16:29 +00:00
Adam Joseph 6f942d4a17
Update lib/meta.nix
Co-authored-by: Naïm Favier <n@monade.li>
2023-01-27 11:16:19 +00:00
Adam Joseph ea0bcf2505 lib/systems/inspect.nix: add platformPatterns.isStatic 2023-01-27 02:21:23 -08:00
Adam Joseph 1690aa6858 lib/meta.nix: allow patterns over entire platform, not just .parsed 2023-01-27 02:19:30 -08:00
Adam Joseph 778419b9e6 Revert "lib/meta.nix: platformMatch: allow predicate functions"
This reverts commit b7d097438b.
2023-01-27 01:49:39 -08:00
Robert Hensing 683887a79c
Merge pull request #212189 from amjoseph-nixpkgs/pr/lib/mapAttrsRecursive/comment
attrsets: clarify that mapAttrs maps over *leaf* attrs
2023-01-25 10:18:38 +01:00
Adam Joseph a4e3e16258
Update lib/attrsets.nix
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-25 02:52:54 +00:00
Pascal Wittmann 353e2d957c
Merge pull request #212408 from raboof/imapsync-fix-license
imapsync: fix license
2023-01-24 11:29:22 +01:00
Arnout Engelen 9b79245235
licenses: add NLPL 2023-01-24 11:24:04 +01:00
Sandro 9441b22187
Merge pull request #209769 from LoveIsGrief/simple-dlna-browser 2023-01-23 23:52:58 +01:00
Adam Joseph ee00af7a32 attrsets: clarify that mapAttrs maps over *leaf* attrs 2023-01-22 15:19:09 -08:00
Adam Joseph b7d097438b lib/meta.nix: platformMatch: allow predicate functions 2023-01-22 00:27:19 -08:00
Atemu 44e5b41871 lib/systems/parse: stop considering armv8a able to execute armv7l
In the past, most (if not all) armv8 CPUs could also execute armv7. However,
with the advent of Apple Silicon, aarch64 CPUs without any aarch32 capabilities
are now wide-spread among users.
2023-01-21 16:28:49 +01:00
Robert Hensing 5b2f597b11 lib.extendDerivation: Fix interaction between output selection and overrideAttrs 2023-01-20 02:45:34 +02:00
Robert Hensing a1b2177ec4
Merge pull request #210976 from clhodapp/fix/extensible-sets
lib: make extender available on self-references
2023-01-20 01:08:16 +01:00
John Ericson c1071e7804
Merge pull request #211622 from alyssais/valgrind-platforms
valgrind: make meta.platforms more accurate
2023-01-19 15:43:22 -05:00
Alyssa Ross 6d165a9474
lib.platforms.s390x: init 2023-01-19 17:43:50 +00:00
Alyssa Ross 541a2a5e91
lib.platforms.power: init 2023-01-19 17:43:49 +00:00
Alyssa Ross 48f3fd2d49
lib.platforms.armv7: init 2023-01-19 17:43:41 +00:00
Silvan Mosberger eac2538707 lib.path.append: init
This function can be used to append strings to Nix path values in a
safe way.
2023-01-18 20:17:31 +01:00
Silvan Mosberger 5c4f616198 lib.path: Minor improvements
- Use isValid when possible instead of subpathInvalidReason: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068714681
- Add documentation to function arguments
- Use newlines for error messages: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1069737602
- Add short comments for the unit test groups: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1072913051
- Slight formatting improvement for laws: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068707955
2023-01-18 18:19:17 +01:00
Robert Hensing 415504e867 lib/tests/release.nix: Make nix a parameter + strictDeps
This makes bisecting nix a bit easier.

Example reproducer, invoked from nix directory:

```bash
nix-build ../nixpkgs/lib/tests/release.nix --arg nix '(builtins.getFlake "git+file://${toString ./.}").packages.x86_64-linux.default'
```
2023-01-18 01:39:38 +01:00
OPNA2608 991a22a7d0 licenses: Remove unnecessary archive.org link for APSL-1.0
SPDX has a copy of it, and the url gets overridden with the spdx.org one anyway.
2023-01-17 12:10:41 +01:00
Chris Hodapp 06f0e49dc6 lib: make extender available on self-references 2023-01-15 11:34:05 -08:00
Nick Cao 35bede2be5
Merge pull request #184521 from dramforever/riscv-isefi
lib/systems/inspect.nix: Add riscv to isEfi
2023-01-13 14:28:11 +08:00
Adam Joseph 098c6b0bec check-meta(hasUnsupportedPlatform): use lib.meta.availableOn
`hasUnsupportedPlatform` was not updated with #37395, so it does not
understand attrsets in `meta.[bad]platforms`.  In particular,
attrsets in `meta.badPlatforms` will "fail open" and be ignored.

Let's use `lib.meta.availableOn` instead of duplicating its logic.

Thanks to @alyssais for [noticing][1].

[1][https://github.com/NixOS/nixpkgs/pull/194148#discussion_r990817610]

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2023-01-11 19:31:52 +00:00
Adam Joseph 0b90e548b5 lib/meta(availableOn): handle missing meta and empty meta.platform 2023-01-11 19:31:52 +00:00
LoveIsGrief 346b939a09
lib/licenses add Fair license 2023-01-10 23:10:24 +01:00
Artturi 6ce54982ec
Merge pull request #209974 from amjoseph-nixpkgs/pr/close/209952 2023-01-10 18:33:27 +02:00
Silvan Mosberger 041b044a66 lib/path/tests: Fix property tests when "-n" is generated
When "-n" is generated by the property tests, it causes `echo` to not
output the string since it's interpreted as an option. Apparently
there's no good way to print "-n" with `echo` [1], so switching to
`printf` instead

[1]: https://unix.stackexchange.com/questions/85846/how-can-i-print-n-with-echo
2023-01-10 14:18:35 +01:00
Adam Joseph 06939ff3de add mipsisa{32,64}r6[el], closes 209952 2023-01-09 16:04:16 -08:00
Naïm Favier fb1bc8de93
lib/modules: make mkAliasOptionModule emit DocBook
Follow-up to https://github.com/NixOS/nixpkgs/pull/208407

Removing `mdDoc` isn't enough, we need to emit actual DocBook.
2023-01-08 22:44:18 +01:00
Silvan Mosberger d35cae9696
Merge pull request #208674 from YoshiRulz/yoshi-lib-docs
lib: Fix mismatched quotes in `lib.*` doc comments
2023-01-05 19:00:38 +01:00
pennae e912c7bfe9 lib/modules: hide _module.args docs
unfortunately we can't unconditionally make this text markdown without
impacting downstream users of docs generation (as noted in #175586).
hide it entirely until the transition is complete.
2023-01-05 02:33:13 +01:00
pennae 9da5f12ecf modules: add mkPackageOptionMD
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05 02:33:13 +01:00
pennae 4c1cfbdb84 modules: add mkAliasOptionModuleMD
mkAliasOptionModule should not default to mdDoc descriptions because
that can break out-of-tree users of documentation infrastructure. add an
explicitly-MD variant for now, to be removed some time after the MD
transition is complete.
2023-01-05 02:33:13 +01:00
Robert Hensing f61d4d346b
Merge pull request #205190 from NixOS/lib.path.relativeNormalise
lib.path.subpath.{isValid,normalise}: init
2023-01-03 13:46:11 +01:00
Silvan Mosberger 0667ef5dd5 lib.path.subpath.normalise: add property tests 2023-01-03 13:21:06 +01:00
Silvan Mosberger 63dd6d20db lib.path.subpath.normalise: init 2023-01-03 13:21:03 +01:00
Silvan Mosberger 98fbcf1788 lib.path.subpath.isValid: init
The first path library function
2023-01-03 13:20:36 +01:00
Silvan Mosberger ba7ed22f84 lib.path: init README.md document
Adds initial work towards a `lib.path` library

Originally proposed in https://github.com/NixOS/nixpkgs/pull/200718, but has
since gone through some revisions

Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2023-01-03 13:19:42 +01:00
Martin Weinelt b38111a665
Merge pull request #208698 from amjoseph-nixpkgs/pr/nss/ilp32 2023-01-03 07:00:45 +01:00
Adam Joseph 14f337afb6 lib/systems/inspect.nix: add isILP32 predicate
I've run into a few packages that need an extra flag on platforms
where `int` has more bits than `void*` does.  I know of three such
platforms:

* [aarch64ilp32], used on both Linux and also on the [Apple Watch]
* [x32], the x86 ILP32 ABI
* [mips64n32], used on [Longsoon] and Cavium Octeon routers.

This PR introduces a predicate so the package flags can be added in
a generic way.

[Apple Watch]: https://gist.github.com/woachk/943828f37c14563a607a26116435bf27#watch
[mips64n32]: https://en.wikipedia.org/wiki/MIPS_architecture#Calling_conventions
[Longsoon]: https://en.wikipedia.org/wiki/Loongson
[x32]: https://en.wikipedia.org/wiki/X32_ABI
2023-01-01 17:16:06 -08:00
Adam Joseph de88969f12 lib/systems: fix uname.processor for powerpc{32,64}, mips64
Cross-compilation of anything downstream of gtk3 requires qemu (due to
gobject-introspection) with --target-list=*-linux-user.  Without this commit,
those qemu builds will fail on a powerpc64le host due to qemu being configured
with --cpu=powerpc64le instead of --cpu=ppc64le.  Unfortunately the build
failure message from qemu in this situation is extremely cryptic.

The root cause turns out not to be the qemu expression, but rather the fact that
on powerpc64le hostPlatform.uname.processor returns the gnu-name (powerpc64le)
for the cpu instead of the linux-name (ppc64le) for the cpu.

uname.processor on mips64el also needs adjustment -- the Linux-name is "mips64"
for both big and little endian (unlike powerpc64, where the Linux-name includes
a "le" suffix):

```
nix@oak:/tmp$ uname -m; lscpu | head -n2
mips64
Architecture:        mips64
Byte Order:          Little Endian
```

uname.processor on powerpc32 has also been adjusted.
2023-01-01 16:20:50 -08:00
YoshiRulz 7fba83890c
lib: Fix mismatched quotes in lib.* doc comments
caused problems for automated rich text generation such as
https://teu5us.github.io/nix-lib.html#customisation-functions
2023-01-02 08:25:17 +10:00
Martin Weinelt 192f844477
lib/trival: Bump oldestSupportedRelease to 2211 2023-01-01 14:57:25 +01:00
Naïm Favier 4af22aab8e
stdenv/check-meta: do deep type checks
Use a wrapper around `mergeDefinitions` to type-check values deeply, so
that e.g. `maintainers = [ 42 ];` is an error.
2023-01-01 14:10:42 +01:00
Naïm Favier 4df10debe7
lib/customisation.overrideDerivation: propagate evaluation condition
The new derivation should evaluate only if the old derivation does.

Sadly this means that the old derivation cannot depend on the new one
any more, which was used by xorgserver on Darwin. But this is not a
problem as `overrideAttrs` can (and should) usually be used instead.

This change allowed catching an invalid `meta.platforms` in the linux_rpi
kernels, which use `overrideDerivation`.
2023-01-01 14:10:42 +01:00
Robert Hensing cb98e26aaf lib: Add isStringLike 2022-12-31 01:47:28 +01:00
Robert Hensing d103811173 lib.isStringLike: Remove use of list
In the current implementation of Nix, this list would be allocated
over and over. Iirc pennae tried to optimize static list allocation,
but gained no significant performance improvement.
2022-12-31 01:33:47 +01:00
Robert Hensing d0d0f7d0aa lib: Add isPath
Available since Nix 2.3, which is the Nixpkgs minimum version.
Thanks zimbatm!
2022-12-31 01:33:47 +01:00
Robert Hensing 23c25d5231 lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike 2022-12-31 01:33:47 +01:00
Robert Hensing 834f0d660a lib.strings: isMoreCoercibleString -> isConvertibleWithToString
Yes, this function name is inconveniently long, but it is important
for the name to explicitly reference the function and not be mistaken
for the implicit string conversions, which only happen for a smaller
set of values.
2022-12-31 01:33:47 +01:00
Robert Hensing 872a24ebbc lib.strings: isSimpleCoercibleString -> isStringLike 2022-12-31 01:33:46 +01:00
Robert Hensing 29efb2c438 lib.types.path: Do not allow lists of strings 2022-12-31 01:03:24 +01:00
Robert Hensing fed5dc66f8 treewide: isCoercibleToString -> isMoreCoercibleToString
No change in behavior.
2022-12-31 01:03:24 +01:00
Robert Hensing 68b6443ed6 lib.strings: Rename isCoercibleToString -> isMoreCoercibleToString 2022-12-31 01:03:24 +01:00
Robert Hensing 3a4c9bdbe6 lib.types.anything: Use isSimpleCoercibleToString
Expecting no change in behavior.
2022-12-31 01:03:24 +01:00
Robert Hensing 03063f65a5 lib.strings.toShellVar: Use isSimpleCoercibleString
Expecting no change in behavior.
2022-12-31 01:03:24 +01:00
Robert Hensing 2b4a8db032 lib.strings.isStorePath: Use isSimpleCoercibleToString
Expecting no change in behavior.
2022-12-31 01:03:24 +01:00
Robert Hensing 67cfc7a8f6 lib.strings: Add isSimpleCoercibleToString 2022-12-31 01:03:23 +01:00
Ryan Lahfa 30307eba48
Merge pull request #207453 from p-h/ulogd
ulogd: init at 2.0.8
2022-12-30 14:13:53 +01:00
Robert Hensing ef9b04ec5f lib.types.loaOf: Update comment to say deprecate instead of remove 2022-12-29 00:49:32 +01:00
Robert Hensing 9af74cc709 Revert "lib/types: remove loaOf"
This reverts commit c8c538f2ab.

Reason: removal did not follow a deprecation process and it hurts
        nixops 1.7 users.
2022-12-29 00:48:22 +01:00
Philippe Hürlimann c3161d81bd linuxdoc-tools: init at 0.9.82
Heavily based on original work by xvuko

Co-authored-by: xvuko <nix@vuko.pl>
2022-12-28 00:17:27 +01:00
Naïm Favier 3fc528ff7f
Merge pull request #207095 from ncfavier/linux-custom-kernel 2022-12-27 17:10:43 +01:00
Sandro f3ae2deafb
Merge pull request #206809 from SuperSandro2000/loaOf 2022-12-25 21:39:52 +01:00
hsjobeki 5ff21bfc73 attrsets: fix and add some doc types 2022-12-24 14:08:11 +01:00
Naïm Favier 0355479715
lib/versions: add pad
Pad a version string with zeros to match a given number of components.
2022-12-21 12:58:21 +01:00
Sandro 708d255245
Merge pull request #205899 from drupol/font/add-garamond-libre
garamond-libre: init at 1.4
2022-12-20 15:56:47 +01:00
Naïm Favier 8b5deda7d8
lib/strings: replace poop emoji (#206999) 2022-12-20 13:48:09 +01:00
Pol Dellaiera c690067fec
garamond-libre: init at 1.4 2022-12-20 08:35:00 +01:00