11 Commits

Author SHA1 Message Date
İlkecan Bozdoğan
e394a579b0 lib: update type signatures
- concrete types start with uppercase: Int, String, Bool, Derivation,
  etc.
- type variables start with lowercase: a, b, etc.
- list:
  - use `[x]` for homogeneous lists instead of `List x` or `[ x ]`
  - use `List` for heterogeneous lists (not that common in `lib`)
- attr:
  - use `AttrSet` for a generic attribute set type
  - use `{ key1 :: Type1; key2 :: Type2; ... }` for adding signatures
    for known attribute names and types
  - use `{ key1 = value1; key2 = value2; ... }` for adding attributes
    with known literals
  - end with an ellipsis (`...`) if the set can contain unknown
    attributes
  - use `{ [String] :: x }` if all the attributes has the same type `x`
- prefer `Any` over `a` if the latter is not reused
2026-03-04 00:10:00 +03:00
İlkecan Bozdoğan
64a8ada54e lib: add type signature to some of the functions 2026-03-02 15:46:43 +00:00
Mikalai Seva
cb9cd986c9 lib: re-export missing builtins in lib
Closes #369215
2026-01-22 18:54:30 +01:00
Johannes Kirschbauer
d89ad6c70e Format: lib/versions.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
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Silvan Mosberger
886e85f4f4 lib.versions: Remove unneeded polyfill
Nix 2.3 (the minimum version needed to evaluate Nixpkgs) supports these, so no need to keep them around.
2024-02-09 05:46:05 +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
Joachim Fasting
fd3052901c lib/versions: expose splitVersion 2019-09-26 17:42:42 +02:00
volth
08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
Ryan Mulligan
a9d0778cd4 lib: add versions library 2018-03-04 06:28:34 -08:00