| Commit message (Expand) | Author | Age | Files | Lines |
| * | lib/systems/inspect.nix: add isAarch•••(cherry picked from commit c6b0b4d0b1157979322b9a08da9433d5f3b2dfec)
| Sandro | 2022-08-25 | 1 | -0/+1 |
| * | Merge pull request #168374 from Ma27/special-attrs-in-with-recursion•••lib/generators: withRecursion: don't break attr-sets with special attrs | Silvan Mosberger | 2022-05-23 | 2 | -1/+26 |
| |\ |
|
| | * | lib/generators: withRecursion: don't break attr-sets with special attrs•••Closes #168327
The issue reported there can be demonstrated with the following
expression:
→ nix-instantiate --eval -E "with import ./. {}; pkgs.lib.options.showDefs [ { file = \"foo\"; value = pkgs.rust.packages.stable.buildRustPackages; } ]"
error: attempt to call something which is not a function but a string
at /home/ma27/Projects/nixpkgs/lib/trivial.nix:442:35:
441| isFunction = f: builtins.isFunction f ||
442| (f ? __functor && isFunction (f.__functor f));
| ^
443|
Basically, if a `__functor` is in an attribute-set at depth-limit,
`__functor` will be set to `"<unevaluated>"`. This however breaks
`lib.isFunction` which checks for a `__functor` by invoking `__functor`
with `f` itself.
The same issue - "magic" attributes being shadowed by `withRecursion` -
also applies to others such as
`__pretty`/`__functionArgs`/`__toString`.
Since these attributes have a low-risk of causing a stack overflow
(because these are flat attr-sets or even functions), ignoring them in
`withRecursion` seems like a valid solution.
| Maximilian Bosch | 2022-04-12 | 2 | -1/+26 |
| * | | lib.systems: remove supported, replace with flakeExposed•••Since the list only gates the platforms the nixpkgs flake exposes
packages to build on, the `hydra` label made little sense. It was also
only used for this purpose, so the `tier*` attributes were largely
unnecessary.
To reflect the intention more accurately, we expose
`lib.systems.flakeExposed` and use it to gate flake.nix's system list.
| sternenseemann | 2022-05-23 | 3 | -27/+39 |
| * | | systems: support cross-compiling for Renesas RX microcontrollers (#173858) | yvt | 2022-05-22 | 4 | -1/+9 |
| * | | Merge pull request #172813 from hercules-ci/functionTo-properly•••`lib.types.functionTo` type merging and docs | Robert Hensing | 2022-05-17 | 3 | -1/+66 |
| |\ \ |
|
| | * | | lib/tests/modules: Test functionTo submodule merging too | Robert Hensing | 2022-05-13 | 2 | -8/+11 |
| | * | | lib.types.functionTo: Add pseudo-attr to generated docs | Robert Hensing | 2022-05-13 | 1 | -1/+1 |
| | * | | lib.types.functionTo: Support type merging | Robert Hensing | 2022-05-13 | 3 | -0/+62 |
| * | | | Merge pull request #170561 from klemensn/types-description•••lib/types: Drop misleading plural from type descriptions | Silvan Mosberger | 2022-05-16 | 2 | -4/+4 |
| |\ \ \ |
|
| | * | | | lib/tests/modules.sh: Fix for singular type descriptions | Robert Hensing | 2022-05-02 | 1 | -1/+1 |
| | * | | | lib/types: Drop misleading plural from type descriptions #170561•••Probably being the most prominent document demonstrating the problem,
configuration.nix(5) describes various types in plural, e.g.
- ` Type: list of strings`
- ` Type: list of systemd options`
However, there are other cases where appending "s" to the inner type
effectively changes the type, e.g.
- ```
Type: list of string matching the pattern
[a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)s
```
This should've read "list of string[s]..." but instead changes the
regular expression.
Simply drop the best-effort plural in favour of correctness and
simplicity rather than adding more grammar related logic/trying to fix
this.
| Klemens Nanni | 2022-04-27 | 1 | -3/+3 |
| * | | | | Revert "lib: init flakes.nix"•••This reverts commit PR #167947.
Flakes aren't standardised and the `lib` namespace shouldn't be
polluted with utilities that serve only experimental uses.
| adisbladis | 2022-05-15 | 5 | -49/+0 |
| | |/ /
|/| | |
|
| * | | | Merge pull request #171946 from ncfavier/toShellVars-derivations•••lib/strings/toShellVars: handle derivations as strings | Robert Hensing | 2022-05-12 | 2 | -4/+17 |
| |\ \ \ |
|
| | * | | | lib/strings/toShellVars: handle derivations as strings | Naïm Favier | 2022-05-07 | 2 | -4/+17 |
| * | | | | lib.licenses: add DRL-1.0•••https://spdx.org/licenses/DRL-1.0.html
https://github.com/SigmaHQ/sigma/blob/master/LICENSE.Detection.Rules.md
| Fabian Affolter | 2022-05-10 | 1 | -0/+5 |
| |/ / / |
|
| * | | | Merge pull request #161156 from a-m-joseph/abort-on-failed-platform-detection...•••platforms.nix: use {} on failed detection instead of silently assuming pc | Rick van Schijndel | 2022-05-04 | 1 | -2/+2 |
| |\ \ \ |
|
| | * | | | platforms.nix: use {} on failed detection instead of silently assuming pc•••This patch causes the autodetection code in lib/systems/platforms.nix
to return {} if it cannot detect the platform and one of the
platform.nix-detection-provided attributes (linux-kernel, gcc, and
rustc) are accessed, rather than silently assuming the "pc" platform
as was previously done.
It is definitely safe to assume that code using these attributes is
prepared to deal with `gcc` and `rustc` not being defined, because
many of the working entries in this file don't define it.
Regarding `linux-kernel` the situation is less certain, but some code
(`lib/systems/default.nix` for example) is already designed to deal
with that attribute being missing. At worst it would result in an
"attribute not found" error.
While adding mips64el bootstrap support to nixpkgs, the silent
assumption that mips64el routers are actually Intel PCs caused
significant frustration. This commit removes that assumption in order
to save people who port nixpkgs to new platforms in the future from
this frustration.
| Adam Joseph | 2022-05-03 | 1 | -2/+2 |
| * | | | | Merge pull request #170090 from danth/has-infix-toString•••lib/strings: call toString within hasInfix | Robert Hensing | 2022-05-02 | 2 | -1/+31 |
| |\ \ \ \ |
|
| | * | | | | lib/tests: add tests for hasInfix•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
| Daniel Thwaites | 2022-05-02 | 1 | -0/+30 |
| | * | | | | lib/strings: convert to string within hasInfix•••This should fix the issue mentioned here:
https://github.com/NixOS/nixpkgs/pull/168175#issuecomment-1107830574
| Daniel Thwaites | 2022-05-01 | 1 | -1/+1 |
| * | | | | | Merge pull request #167947 from MatthewCroughan/mc/callLocklessFlake•••lib: add callLocklessFlake | Artturi | 2022-05-01 | 5 | -0/+48 |
| |\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | * | | | | lib/tests: evaluate value from subflake with callLocklessFlake | matthewcroughan | 2022-04-12 | 3 | -8/+8 |
| | * | | | | lib/tests: use subflake to test callLocklessFlake | matthewcroughan | 2022-04-12 | 3 | -3/+16 |
| | * | | | | lib/tests: add test for callLocklessFlake | matthewcroughan | 2022-04-12 | 1 | -0/+9 |
| | * | | | | lib: init flakes.nix•••This commit creates flakes.nix, which is a library containing functions
which relate to interacting with flakes. It also moves related functions
from trivial.nix into it.
| matthewcroughan | 2022-04-12 | 3 | -17/+27 |
| | * | | | | lib: add callLocklessFlake•••This is essentially a copy of the function of the same name, from
flake-compat. callLocklessFlake is useful when trying to utilise a
flake.nix without a lock file, often for when you want to create a
subflake from within a parent flake.
Co-authored-by: Tom Bereknyei <tomberek@gmail.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
| matthewcroughan | 2022-04-12 | 2 | -1/+17 |
| | | |_|/
| |/| | |
|
| * | | | | Merge pull request #167776 from hercules-ci/lib-modules-allow-disable-_module...•••lib.modules: Allow making _module.args internal | Robert Hensing | 2022-04-30 | 1 | -1/+4 |
| |\ \ \ \ |
|
| | * | | | | lib.modules: Allow making _module.args internal•••This allows other module system consumers to
disable these docs via option merging.
For instance arion uses asciidoc instead of
docbook so that would look awful.
| Robert Hensing | 2022-04-11 | 1 | -1/+4 |
| | |/ / / |
|
| * | | | | lib.systems: add riscv{32,64} sets and filters•••For other platforms like Intel and ARM, we can do
e.g. lib.platforms.aarch64 to get only the 64-bit ARM platorms, but
until now there were no equivalents for RISC-V.
| Alyssa Ross | 2022-04-28 | 3 | -0/+6 |
| * | | | | lib/tests: add RISC-V test | Alyssa Ross | 2022-04-28 | 1 | -0/+1 |
| * | | | | Merge pull request #170583 from ncfavier/mkShellVars•••lib/strings: add toShellVars | Robert Hensing | 2022-04-27 | 3 | -1/+82 |
| |\ \ \ \
| |_|_|/
|/| | | |
|
| | * | | | lib/strings: fix quoting of example•••Co-authored-by: Silvan Mosberger <github@infinisil.com> | Naïm Camille Favier | 2022-04-27 | 1 | -1/+1 |
| | * | | | lib/strings: add toShellVars•••A straightforward piece of plumbing to safely inject Nix variables into
shell scripts:
''
${lib.toShellVars { inherit foo bar; }}
cmd "$foo" --bar "$bar"
''
| Naïm Favier | 2022-04-27 | 3 | -1/+82 |
| * | | | | Merge pull request #167247 from Artturin/addgetmainprog•••lib/meta: add getExe to get the main program of a drv | Artturi | 2022-04-26 | 2 | -1/+15 |
| |\ \ \ \
| |/ / /
|/| | | |
|
| | * | | | lib/meta: add getExe to get the main program of a drv | Artturin | 2022-04-24 | 2 | -1/+15 |
| * | | | | Merge pull request #168778 from hercules-ci/issue-168767-extendModules-module...•••`lib.types.submoduleWith`: Avoid `_key` collisions after `extendModules` (issue #168767) | Robert Hensing | 2022-04-26 | 4 | -4/+61 |
| |\ \ \ \ |
|
| | * | | | | lib.types.submoduleWith: Avoid _key collisions after extendModules | Robert Hensing | 2022-04-24 | 4 | -4/+61 |
| | | |/ /
| |/| | |
|
| * | | | | Merge pull request #168111 from a-m-joseph/lib-systems-inspect-powerpc•••lib/systems/inspect.nix: add isPower64 | Sandro | 2022-04-25 | 1 | -0/+1 |
| |\ \ \ \ |
|
| | * | | | | lib/systems/inspect.nix: add isPower64•••This commit adds an `isPower64` predicate to the two existing
predicates for this architecture (`isPower` and `isPowerPC`).
Note that `isPowerPC` matches only 32-bit machines, whereas `isPower`
matches both 64-bit and 32-bit machines. Prior to this commit there
was no single `isXXX` predicate for `powerpc64le`.
| Adam Joseph | 2022-04-10 | 1 | -0/+1 |
| | |/ / / |
|
| * | / / | lib/strings: optimise hasInfix function (#168175)•••* lib/strings: optimise hasInfix function
* lib/strings: optimise hasInfix further using regex
* rstudio: call hasInfix with a string
* lib/strings: remove let from hasInfix
Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> | Daniel Thwaites | 2022-04-22 | 1 | -4/+1 |
| | |/ /
|/| | |
|
| * | | | lib/systems/platforms: correctly import examples.nix•••before: :p lib.systems failed with
error: getting status of '...examples': no such file or directory
| Artturin | 2022-04-15 | 1 | -1/+1 |
| |/ / |
|
| * | | Merge pull request #164088 from Profpatsch/lib.generators-add-toINIWithGlobal...•••lib.generators: add toINIWithGlobalSection | Silvan Mosberger | 2022-04-06 | 2 | -2/+107 |
| |\ \
| |/
|/| |
|
| | * | lib.generators: fix references to test file | Profpatsch | 2022-03-14 | 1 | -3/+3 |
| | * | lib.generators: add toINIWithGlobalSection•••As discussed in
https://github.com/NixOS/nixpkgs/pull/118925#issuecomment-821112723,
this is the best way of adding global sections to `toINI` without
employing heuristics (i.e. checking whether something is an attrset).
| Profpatsch | 2022-03-14 | 2 | -0/+105 |
| * | | Merge pull request #165540 from Infinisil/module-args-docs•••lib/modules: Document `_module.args` | Robert Hensing | 2022-04-05 | 2 | -4/+88 |
| |\ \ |
|
| | * | | lib/modules: Document _module.args•••Documents the _module.args option, motivated by many usages in Flakes,
especially with the deprecation of extraArgs
(https://github.com/NixOS/nixpkgs/commit/78ada833615d241ed76463aa5a024b614150eb4d)
The documentation rendering for this option had to be handled a bit
specially, since it's not declared in nixos/modules like all the other
NixOS options.
Co-Authored-By: pennae <github@quasiparticle.net>
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
| Silvan Mosberger | 2022-04-05 | 2 | -4/+88 |
| * | | | Merge pull request #166383 from hercules-ci/always-sanitize-derivation-name•••Always sanitize derivation name | Robert Hensing | 2022-04-05 | 2 | -1/+13 |
| |\ \ \ |
|
| | * | | | lib.sanitizeDerivationName: Simplify regex•••`^` and `$` are implicit in `match`.
| Robert Hensing | 2022-04-05 | 1 | -1/+1 |
| | * | | | lib.sanitizeDerivationName: Test with unicode | Robert Hensing | 2022-03-31 | 1 | -0/+5 |