Age | Commit message (Collapse) | Author | Files | Lines |
|
This allows for adding new, conditionally set, derivation attributes
to an existing derivation without changing any output paths in the
case where the condition is not met.
|
|
lib.packagesFromDirectoryRecursive: init
|
|
Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>
|
|
A more efficient sort in some cases, and often convenient.
This exposes `lib.lists.sortOn` immediately on `lib`, because it is
a sibling of `sort`, which is already present there.
Omitting it would lead to more confusion, and worse outcomes.
There's no confusion about the types `sort` or `sortOn` operate on.
Haskell agrees about the type for `sortOn`, and it is in its `base`.
|
|
lib.lists.allUnique: init
|
|
|
|
Co-authored-by: Silvan Mosberger <github@infinisil.com>
|
|
lib.attrsets.attrsToList: add function
|
|
For transforming back between lists and attrsets, it makes sense to have
a quasi-inverse of `builtins.listToAttrs` available as a library
function.
Co-authored-by: Silvan Mosberger <github@infinisil.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
|
|
|
|
File set combinators base: `lib.fileset.toSource`
|
|
|
|
nixos/dconf: support generating from attrs
|
|
amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing2
|
|
|
|
Deeply-curried functions are pretty error-prone in untyped languages
like Nix. This is a particularly bad case because
`top-level/splice.nix` *also* declares a makeScopeWithSplicing, but
it takes *two fewer arguments*.
Let's add a version that uses attrset-passing form, to provide some
minimal level of sanity-checking.
This also provides defaults for keep and extra (these are often
unneeded by the user).
|
|
getExe' can be used to get a binary other than the mainProgram from a
derivation.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|
no longer supported. warning when used would not be appropriate, and
docbook has been on the way out for long enough that throwing an error
should not be necessary either.
|
|
These functions only work with the filesystem, they don't import
anything as sources
|
|
- provide comprehensive example
- add unit test
|
|
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".
|
|
|
|
lib.lists: add `replicate`
|
|
`replicate` returns n copies of an element as a list.
Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
|
|
lib/strings: add `concatLines`
|
|
lib: Fix mismatched quotes in `lib.*` doc comments
|
|
another transitional option factory, like 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.
|
|
lib.path.subpath.{isValid,normalise}: init
|
|
The first path library function
|
|
caused problems for automated rich text generation such as
https://teu5us.github.io/nix-lib.html#customisation-functions
|
|
|
|
Available since Nix 2.3, which is the Nixpkgs minimum version.
Thanks zimbatm!
|
|
Like `unlines` from Haskell.
The aim is to replace the `concatStringsSep "\n"` pattern for generated
files, which doesn't add a final newline.
|
|
To bring them to the scope when calling `lib`.
|
|
|
|
|
|
|
|
|
|
|
|
lib: add inPureEvalMode
|
|
heavily based on patterns used by licenses infrastructure, so may
appear overengineered for its initial level of use
|
|
This reverts commit PR #167947.
Flakes aren't standardised and the `lib` namespace shouldn't be
polluted with utilities that serve only experimental uses.
|
|
This makes a value that is true if builtins does not contain the
currentSystem function, but false if it does.
|
|
lib: add callLocklessFlake
|
|
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"
''
|
|
|
|
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.
|
|
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>
|