Commit graph

4484 commits

Author SHA1 Message Date
nicoo
93d76b7344 lib.packagesFromDirectoryRecursive: reject unknown arguments
see [discussion](https://github.com/NixOS/nixpkgs/pull/270537#discussion_r1862458435)
2025-03-26 12:11:44 +01:00
nicoo
6cc285d613 lib.packagesFromDirectoryRecursive: hoist processDir out of the lambda
Fixes a bug preventing `recurseIntoDirectory` from changing the `directory` argument.

Moreover, `processDir` now cannot capture arguments from the `packagesFromDirectoryRecursive` call,
entirely preventing this class of bug from reoccurring should new parameters be added etc.
2025-03-26 12:11:44 +01:00
nicoo
32235deeb8 lib.packagesFromDirectoryRecursive: default to creating new scopes when newScope is provided
Co-authored-by: Rebecca Turner <rbt@sent.as>
2025-03-26 12:11:44 +01:00
nicoo
41f219d1d9 lib.packagesFromDirectoryRecursive: add tests for nested scopes 2025-03-26 12:11:43 +01:00
nicoo
6b7576b0cf lib.packagesFromDirectoryRecursive: use explicit recursion, support nested scopes 2025-03-26 12:11:43 +01:00
nicoo
fdd2c6f80f lib/tests: move packages-from-directory/* into a subdir
in preparation for adding more tests for `lib.packagesFromDirectoryRecursive`
2025-03-24 18:35:26 +01:00
nicoo
325b3755f5 lib.filesystem: remove dead let-bindings
Found by `deadnix` 🖤
2025-03-24 18:35:25 +01:00
Tristan Ross
05219927d0
lib.systems: mark LLVM libc as static 2025-03-24 06:55:06 -07:00
Ross Smyth
57ec4f3128 lib.systems: Add arm-embedded-nano
Newlib-nano variant of the arm-embedded stdenv.
2025-03-20 16:15:09 -04:00
Johannes Kirschbauer
484a0477d8
lib/types: types.either deprecate functor.wrapped in favor of functor.payload.elemType 2025-03-20 14:11:34 +00:00
Silvan Mosberger
987a096334
lib/types: types deprecate functor.wrapped in favor of functor.payload.elemType for trivial cases (#375084) 2025-03-20 14:28:57 +01:00
Felix Bühler
30358ab7a7
formats.lua: init; types.luaInline: init (#390120) 2025-03-19 23:18:05 +01:00
nikstur
02843300bb lib.licenses.asl20-llvm: replace with separate llvm-exception
This essentially reverts 7ce8e7c4cf

asl20-llvm does not produce a valid SPDX ID, it produces a valid SPDX
Expression. However, this is not what the spdxId field promises.

This is relevant because we cannot produce valid SBOMs (e.g. CycloneDX)
using this field as the schemas for these SBOMs check that the IDs are
valid.

This change leaves us with consistently valid SPDX IDs at the cost
of slightly less convenience.
2025-03-17 13:05:21 +01:00
sanana
8e1e15cf11
lib/licenses: add bsdAxisNoDisclaimerUnmodified
This is a variant composed of clause 1 and 3 of a BSD-Modified found in the
Linux kernel and this extra variant has the words "without modification" added
at the end of clause 1 either with or without a comma. It also lacks the
warranty disclaimer.

See <https://scancode-licensedb.aboutcode.org/bsd-no-disclaimer-unmodified.html>.
2025-03-16 14:22:00 +03:00
Matt Sturgeon
0be0e7529b
lib.generators.toLua: support path-values 2025-03-15 11:40:47 +00:00
Matt Sturgeon
c347d605c9
lib.types: add luaInline
Represents inline lua as expected by `lib.generators.toLua`, for
embedding raw lua expressions within structurally generated lua.
2025-03-15 10:29:28 +00:00
Matt Sturgeon
7436684102
lib.generators: alias mkLuaInline at the top-level 2025-03-15 10:26:57 +00:00
Johannes Kirschbauer
4f123107b4
lib/types: types.coercedTo deprecate functor.wrapped in favor of functor.payload.elemType 2025-03-15 00:46:02 +09:00
Johannes Kirschbauer
f6214eb786
lib/types: types.functionTo deprecate functor.wrapped in favor of functor.payload.elemType 2025-03-15 00:45:39 +09:00
Johannes Kirschbauer
4fe25460e1
lib/types: types.nullOr deprecate functor.wrapped in favor of functor.payload.elemType 2025-03-15 00:45:30 +09:00
Johannes Kirschbauer
05958f27e2
lib/types: types.{unique,uniq} deprecate functor.wrapped in favor of functor.payload.elemType 2025-03-15 00:05:55 +09:00
Robert Hensing
877ebad7fa
lib/path: allow CA paths in hasStorePathPrefix (#386774) 2025-03-12 19:32:12 +00:00
toborwinner
ff9b3598e6
lib.modules: simplified logic in zipAttrsWith and minor cleanup 2025-03-10 17:05:22 +01:00
Mikael Voss
7a07cc0da9
lib/strings: allow CA paths in isStorePath 2025-03-05 13:08:41 +01:00
Mikael Voss
6e2e984af0
lib/path: allow CA paths in hasStorePathPrefix 2025-03-05 10:30:08 +01:00
Wroclaw
0de1d18795 lib.types.functionTo: preserve functionArgs
Previously if function in defs had set pattern in argument,
this information would be lost.

This keeps functionArgs in set pattern,
by using functor and `__functionArgs`
that is later used by `lib.functionArgs`.
2025-03-02 00:04:19 +01:00
Johannes Kirschbauer
0e46672592
lib.types: Make functor.wrapped deprecation work in unprocessed types (#382848) 2025-02-21 15:57:20 +07:00
Johannes Kirschbauer
0d52202380
lib.strings: init toSentenceCase (#381802) 2025-02-20 07:58:44 +07:00
Martin Fink
2607578cc4 lib.systems.architectures: add sierra forest 2025-02-19 19:25:03 +01:00
isabel
b109863c25 lib.strings: init toSentenceCase 2025-02-19 12:10:39 +00:00
Johannes Kirschbauer
fb79705bca
lib.types: improve tests for deprecation warning on all migrated types 2025-02-19 16:54:55 +07:00
Silvan Mosberger
64a1c1da3e
lib.types: Make functor.wrapped deprecation work in unprocessed types
Otherwise nested types such as `attrsOf (attrsOf int)` won't have a
backwards compatible `type.nestedTypes.elemType.functor.wrapped`.

Follow-up work to https://github.com/NixOS/nixpkgs/pull/366015
2025-02-19 16:10:27 +07:00
Johannes Kirschbauer
7bbacbb11b
Revert "lib.types.attrsWith: remove failing test" (#382856) 2025-02-19 16:07:48 +07:00
lassulus
642babe809
Docs: migrate format of comments to doc-comments (#381381) 2025-02-19 13:51:23 +07:00
Johannes Kirschbauer
3f9d8a1fea
lib/pathWith: keep old typename, to avoid breakage in downstream projects 2025-02-19 09:03:18 +07:00
Silvan Mosberger
bdddb0c517 Revert "lib.types.attrsWith: remove failing test"
This reverts commit ce8f304bb6.

The problem was simply a typo (nestedTypes.elemType ->
type.nestedTypes.elemType) ! And CI didn't run for lib in the orginal
PR which is why it didn't get caught.
2025-02-17 16:19:40 +01:00
Johannes Kirschbauer
2f6b75b26a
lib/types: add types.pathWith (#373287) 2025-02-17 09:56:48 +07:00
Jeremy Fleischman
6d7f6a92cc
lib/types: add types.pathWith
This gives people some flexibility when they need a path type, and
prevents a "combinatorial explosion" of various path stops.

I've re-implemented our existing `path` and `pathInStore` types using
`pathWith`. Our existing `package` type is potentially a candidate for
similar treatment, but it's a little quirkier (there's some stuff with
`builtins.hasContext` and `toDerivation` that I don't completely
understand), and I didn't want to muddy this PR with that.

As a happy side effect of this work, we get a new feature: the ability
to create a type for paths *not* in the store. This is useful for when a
module needs a path to a file, and wants to protect people from
accidentally leaking that file into the nix store.
2025-02-15 16:14:06 +07:00
Daniel Flanagan
208049c89c
docs(lib): fix weird structures in attrsets docstrings 2025-02-14 23:04:58 -06:00
Johannes Kirschbauer
ef85e0daa0
Format: lib/path.nix 2025-02-12 15:01:45 +07:00
Johannes Kirschbauer
d89ad6c70e
Format: lib/versions.nix 2025-02-12 15:01:45 +07:00
Johannes Kirschbauer
e0fe216f49
Format: lib/fileset/internal.nix 2025-02-12 15:01:45 +07:00
Johannes Kirschbauer
80d5b411f6
Format: lib/sources.nix 2025-02-12 15:01:45 +07:00
Johannes Kirschbauer
88f912da48
Docs: migrate format of comments to doc-comments 2025-02-12 15:01:43 +07:00
Johannes Kirschbauer
9d3e649939
lib.types: init mergeTypes (#364620) 2025-02-10 22:10:30 +07:00
Johannes Kirschbauer
3c911b2aca
lib.types: init mergeTypes 2025-02-10 21:23:12 +07:00
Robert Hensing
a7c201020d
lib: Discourage use of extend (#376033) 2025-02-09 21:04:55 +01:00
Mathias Koehler
8722c7acbd lib.systems: add znver5 architecture 2025-02-09 19:07:42 +01:00
Robert Hensing
832e3542b6
lib/modules: improve mismatching class error mesage (#377345) 2025-02-08 17:54:09 +01:00
Gutyina Gergő
547acecdf3
teamspeak5_client: 5.0.0-beta77 -> 6.0.0-beta2; teamspeak refactors (#377748)
* teamspeak5_client: 5.0.0-beta77 -> 6.0.0-beta2, rename to teamspeak-6-client

* teamspeak6-client: refactor

* lib.licenses: add teamspeak license

* teamspeak{3,_server,6-client}: use teamspeak license

* teamspeak{6-client,_server}: move to pkgs/by-name

* teamspeak_server: fix meta.platforms

* teamspeak6-client: add update script
2025-02-07 20:33:09 +01:00