Age | Commit message (Collapse) | Author | Files | Lines |
|
lib: use explicit name imports in `lib/deprecated.nix`
|
|
lib: avoid top-level `with ...;` in lib/kernel.nix
|
|
* doc: lib.lists migrate to doc-comments
* Fix extra indentation of docs lines, remove redundant comments, add inputs docs
* fix: indentation & argument references
---------
Co-authored-by: DS <commits@sidhion.com>
|
|
|
|
lib/tests/modules/extendModules-168767-imports.nix
|
|
|
|
lib/tests/modules/alias-with-priority-can-override.nix
|
|
|
|
* doc: actually document `lib.customisation.makeScope`
|
|
|
|
|
|
lib.toInt/toIntBase10: Make more efficient by hoisting up internal strings into higher scope
|
|
lib.getAttrFromPath: Don't use errorMessage variable
|
|
lib.mapAttrsRecursiveCond: Eliminate intermediate one intermediate variable environment
|
|
lib.zipAttrs: Remove needless function wrapping
|
|
lib.chooseDevOutputs: Remove needless function wrapping
|
|
lib.lazyDerivation: Support multi-output derivations
|
|
* doc: add details on `mapAttrsRecursive[Cond]`
from first reading it wasn't clear that `f` also takes the current
attribute path. also the value f receives is tricky due to how the
condition is evaluated.
Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com>
|
|
lib/customization: propagate function arguments in callPackagesWith
|
|
`lib/` flake: fix `lib.version`
|
|
into higher scope
|
|
We can just pass the error message on without creating an environment.
|
|
environment
|
|
Returning the partially applied `zipAttrsWith fn` is the same as `sets: zipAttrsWith fn sets`.
|
|
Returning the partially applied `map getDev` is the same as `drvs: map getDev drvs`.
|
|
lib.fixedPoints: fix rendering of docs for `extends`
|
|
|
|
|
|
`lib`: Remove unneeded polyfills
|
|
makeOverridable is very careful to ensure the arguments to the
overridden function are the same as the input function. As a result,
the arguments of hello.override are exactly the same as the original
arguments of the hello function that produced the derivation.
However, callPackagesWith calls makeOverridable with a lambda that
does not propagate the arguments. The override function for a package
instantiated with callPackagesWith will not have the original
arguments.
For example:
nix-repl> lib.functionArgs hello.override
{ callPackage = false; fetchurl = false; hello = false; lib = false; nixos = false; stdenv = false; testers = false; }
nix-repl> lib.functionArgs openssl.override
{ }
By copying the arguments onto the inner lambda before passing it to
makeOverridable, we can make callPackage and callPackages behave the
same.
nix-repl> lib.functionArgs openssl.override
{ buildPackages = false; coreutils = false; cryptodev = false; enableSSL2 = true; enableSSL3 = true; fetchurl = false; lib = false; perl = false; removeReferencesTo = false; static = true; stdenv = false; withCryptodev = true; withPerl = true; }
|
|
lib.fileset: Fix tests on Darwin, more POSIX
|
|
This was found when trying to run the fileset tests on Darwin
(https://github.com/NixOS/nix/pull/9546#issuecomment-1967409445), which mysteriously fail on Darwin:
test case at lib/fileset/tests.sh:342 failed: toSource { root = "/nix/store/foobar"; fileset = ./.; } should have errored with this regex pattern:
lib.fileset.toSource: `root` \(/nix/store/foobar\) is a string-like value, but it should be a path instead.
\s*Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.
but this was the actual error:
error: lib.fileset.toSource: `root` (/nix/store/foobar) is a string-like value, but it should be a path instead.
Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.
After dissecting this, I find out that apparently \s works on Linux, but not on Darwin for some reason!
From the bash source code, it looks like <regex.h> with `REG_EXTENDED` is used for all platforms the same,
so there's nothing odd there.
It's almost impossible to know where <regex.h> comes from,
but it looks to be a POSIX thing.
So after digging through the almost impossible to find POSIX specifications
(https://pubs.opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003_005),
I can indeed confirm that there's no mention of \s or the like!
_However_, there is a mention of `[[:blank:]]`, so we'll use that instead.
|
|
lib.meta.availableOn: add example in documentation
|
|
|
|
|
|
|
|
This way we don't have to make sure they're in sync, and we remove
a small step from the release process.
|
|
Manually tested with
nix-repl> :lf path:lib
nix-repl> lib.version
|
|
lib.fileset.toList: init
|
|
lib: export attrsets.mergeAttrsList
|
|
|
|
|
|
See https://github.com/NixOS/nix/pull/9900
|
|
lib.modules.doRename: Add doc comments
|
|
|
|
I don't think these are rendered yet, but this at least provides
the content.
Follow-up to https://github.com/NixOS/nixpkgs/pull/285612
|
|
|
|
lib.types.unique: Check inner type deeply
|
|
lib/systems/inspect: add `isSparc64`
|
|
Nix 2.3 (the minimum version needed to evaluate Nixpkgs) supports these, so no need to keep them around.
|