| Commit message (Expand) | Author | Age | Files | Lines |
| * | lib.options.mkPackageOption: use lib.showAttrPath•••Make use of `lib.showAttrPath` instead of manually doing `concatStringsSep "."`.
This means edge-cases such as the attr-path including names that are not
valid nix identifiers will be handled better.
See:
- https://nix.dev/manual/nix/2.26/language/identifiers
- https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.showAttrPath
| Matt Sturgeon | 2025-04-13 | 1 | -4/+6 |
| * | treewide: Format all Nix files•••Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
| Silvan Mosberger | 2025-04-01 | 1 | -176/+239 |
| * | Docs: migrate format of comments to doc-comments | Johannes Kirschbauer | 2025-02-12 | 1 | -41/+137 |
| * | doc: improve lib.options reference documentation (#316862)•••* Doc: lib/options fixup wording and references
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Silvan Mosberger <github@infinisil.com> | Johannes Kirschbauer | 2025-01-13 | 1 | -116/+329 |
| * | treewide: Fix incorrect string escapes | piegames | 2025-01-07 | 1 | -1/+1 |
| * | lib.types.attrsWith: add placeholder parameter | Johannes Kirschbauer | 2024-12-09 | 1 | -11/+8 |
| * | lib/options: remove mdDoc•••Following through on message itself.
| Wolfgang Walther | 2024-11-22 | 1 | -7/+0 |
| * | lib: deprecate mkPackageOptionMD | éclairevoyant | 2024-06-26 | 1 | -3/+3 |
| * | lib: clarify warning about mdDoc | éclairevoyant | 2024-04-15 | 1 | -1/+1 |
| * | lib.mdDoc: remove and replace with warning | stuebinm | 2024-04-13 | 1 | -2/+4 |
| * | Merge pull request #284512 from hercules-ci/lib-types-unique-merge•••lib.types.unique: Check inner type deeply | Silvan Mosberger | 2024-02-10 | 1 | -5/+23 |
| |\ |
|
| | * | lib.option.mergeUniqueOption: Simplify and add warning about merge function•••The previous code was optimized for the old uniq behavior, which did not
call merge. That's changed, so the legacy path is not a hot path anymore,
and is not worth any tech debt.
| Robert Hensing | 2024-02-04 | 1 | -16/+11 |
| | * | lib.types.unique: Check inner type deeply•••This doesn't change uniq. Why not?
- In NixOS it seems that uniq is only used with
simple types that are fully checked by t.check.
- It exists for much longer and is used more widely.
- I believe we should deprecate it, because unique was
already better.
- unique can be a proving ground.
| Robert Hensing | 2024-01-28 | 1 | -5/+28 |
| * | | lib: make deprecation warnings consistent•••The deprecation warnings in lib were wildly inconsistent. Different
formulations were used in different places for the same meaning. Some warnings
used builtins.trace instead of lib.warn, which prevents silencing; one even
only had a comment instead. Make everything more uniform.
| Alois Wohlschlager | 2024-02-03 | 1 | -1/+1 |
| |/ |
|
| * | lib: Take advantage of section descriptions•••See https://github.com/nix-community/nixdoc/releases/tag/v2.6.0
| Silvan Mosberger | 2023-11-20 | 1 | -1/+1 |
| * | lib/options: refactor mkPackageOption | Anselm Schüler | 2023-10-10 | 1 | -13/+13 |
| * | lib/options: add pkgsText parameter to mkPackageOption | Anselm Schüler | 2023-10-06 | 1 | -7/+22 |
| * | lib/options: correct and improve documentation of mkPackageOption | Anselm Schüler | 2023-10-06 | 1 | -13/+36 |
| * | lib: turn *MD functions into aliases•••with docbook gone and MD the default these aren't needed any more. we
can't remove them yet because there's thousands of uses, but maybe some
day we can.
| pennae | 2023-06-13 | 1 | -12/+7 |
| * | lib/options: remove literalDocBook•••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.
| pennae | 2023-06-13 | 1 | -13/+1 |
| * | lib/options: nullable mkPackageOption•••It is sometimes useful to allow setting a package option to `null` to
skip installing the package. See
https://github.com/nix-community/home-manager/pull/3668#issuecomment-1554044171
for example.
| Naïm Favier | 2023-05-19 | 1 | -7/+14 |
| * | lib/options: fix rendering of options with only a defaultText•••Some options have their default value set in the `config` instead of
`default`, for example to push `mkDefault`s down an attribute set.
In those cases, it's useful to provide a `defaultText` for informational
purposes.
| Naïm Favier | 2023-05-06 | 1 | -3/+3 |
| * | lib/options: fix mkPackageOption docs•••nixdoc takes everything from Type: to Example: as the type, which
misrendered a large part of the docs. it also drops sorely needed spaces
where the type had line breaks, so all has to be on one line (or use
non-standard literal spaces, which is probably worse).
also clarify what the `?` for arguments mean while we're here.
| pennae | 2023-03-05 | 1 | -7/+5 |
| * | lib/options: Add more options to mkPackageOption | Anselm Schüler | 2023-02-26 | 1 | -15/+48 |
| * | lib/options: update showOption comment | Naïm Favier | 2023-02-18 | 1 | -6/+4 |
| * | types: suggest how to resolve the conflict | Domen Kožar | 2023-02-09 | 1 | -2/+5 |
| * | types: explicitly state unique options are expected to be unique | Domen Kožar | 2023-02-09 | 1 | -1/+1 |
| * | lib: standardise attrset type syntax•••There are a number of different syntaxes used for attrset type
signatures in our doc strings, this change standardises upon one that
uses :: for specifying attribute type, and ; terminators to be
consistent with nix syntax. There are no bugs in the functions
themselves, just that different syntaxes may confuse new users.
| Colin Arnott | 2023-01-30 | 1 | -3/+3 |
| * | modules: add mkPackageOptionMD•••another transitional option factory, like mkAliasOptionModuleMD.
| pennae | 2023-01-05 | 1 | -1/+6 |
| * | attrsets: fix and add some doc types | hsjobeki | 2022-12-24 | 1 | -2/+2 |
| * | lib.modules: Add error context to rendered default and example attrs | Robert Hensing | 2022-12-10 | 1 | -3/+14 |
| * | nixos/doc: render option values using `lib.generators.toPretty`•••Render un`_type`d defaults and examples as `literalExpression`s using
`lib.generators.toPretty` so that consumers don't have to reinvent Nix
pretty-printing. `renderOptionValue` is kept internal for now intentionally.
Make `toPretty` print floats as valid Nix values (without a tilde).
Get rid of the now-obsolete `substSpecial` function.
Move towards disallowing evaluation of packages in the manual by
raising a warning on `pkgs.foo.{outPath,drvPath}`; later, this should
throw an error. Instead, module authors should use `literalExpression`
and `mkPackageOption`.
| Naïm Favier | 2022-12-08 | 1 | -4/+17 |
| * | haskell.compiler.ghc92: 9.2.4 -> 9.2.5 | sternenseemann | 2022-11-07 | 1 | -1/+1 |
| * | lib/options/showOption: fix quoting of attr-names that are not identifiers•••Personally, I think that warnings such as
warning: The option `services.redis.enable' defined in `/home/ma27/Projects/nixpkgs/test.nix@node-vm' has been renamed to `services.redis.servers..enable'.
are fairly confusing because of the `..` and it's more correct to
actually quote that. With this change the warning now looks like this:
warning: The option `services.redis.enable' defined in `/home/ma27/Projects/nixpkgs/test.nix@node-vm' has been renamed to `services.redis.servers."".enable'.
While implementing that I realized that you'd have
a similar problem whenever you use attribute-names that aren't
identifiers, e.g.
services.nginx.virtualHosts."example.org".locations."/".invalid = 23;
now results in the following error:
error: The option `interactive.nodes.vm.services.nginx.virtualHosts."example.org".locations."/".invalid' does not exist. Definition values:
- In `/home/ma27/Projects/nixpkgs/test.nix@node-vm': 23
Of course there are some corner-cases where this won't work: when
generating the manual, you display submodules like this:
services.nginx.virtualHosts.<name>
Since `<name>` isn't a value, but an indicator for a submodule, it must
not be quoted. This also applies to the following identifiers:
* `*` for `listOf submodule`
* `<function body>` for `functionTo`
This might not be correct if you actually have a submodule with an
attribute name called `<name>`, but I think it's an improvement over the
current situation and for this you'd probably need to make even more
complex changes to the module system.
| Maximilian Bosch | 2022-10-07 | 1 | -3/+9 |
| * | lib/options.nix: remove unused binding | figsoda | 2022-09-26 | 1 | -1/+0 |
| * | lib/options: deprecate docbook text and literalDocBook•••deprecate literalDocBook by adding a warning (that will not fire yet) to
its uses and other docbook literal strings by adding optional warning
message to mergeJSON.
| pennae | 2022-09-10 | 1 | -1/+4 |
| * | lib/modules: convert option description to MD | pennae | 2022-08-31 | 1 | -1/+1 |
| * | lib/options: add mdDoc support to mkEnableOption | pennae | 2022-08-30 | 1 | -1/+4 |
| * | haskell.compiler: ghc923 -> ghc924•••https://www.haskell.org/ghc/download_ghc_9_2_4.html
| sternenseemann | 2022-07-28 | 1 | -1/+1 |
| * | lib/options: Add hint for debugging infinite recursion in docs | Robert Hensing | 2022-06-27 | 1 | -0/+2 |
| * | lib/options: Add showOptionWithDefLocs | Robert Hensing | 2022-06-21 | 1 | -0/+6 |
| * | treewide: attempt at markdown option docs | pennae | 2022-06-12 | 1 | -0/+15 |
| * | haskell.compiler: ghc922 -> ghc923•••https://www.haskell.org/ghc/download_ghc_9_2_3.html
Since the tarball is generated by Hadrian, neither autoreconf nor ./boot
is executed so ./configure and ghc.mk is missing.
| sternenseemann | 2022-05-28 | 1 | -1/+1 |
| * | Merge remote-tracking branch 'origin/master' into haskell-updates | sternenseemann | 2022-03-26 | 1 | -2/+0 |
| |\ |
|
| | * | lib/modules: Finally remove deprecated types.optionSet•••types.optionSet has been deprecated for almost 10 years now
(0e333688cea468a28516bf6935648c03ed62a7bb)! A removal
was already attempted in 2019
(27982b408e465554b8831f492362bc87ed0ec02a), but it was promptly
reinstantiated since some third-party uses were discovered
(f531ce75e4178c6867cc1d0f7fec96b2d5c3f1cb).
It's finally time to remove it for good :)
| Silvan Mosberger | 2022-03-18 | 1 | -2/+0 |
| * | | Merge master into haskell-updates | github-actions[bot] | 2022-03-17 | 1 | -1/+1 |
| |\| |
|
| | * | lib/options: Throw error for options without a type•••Makes all options rendered in the manual throw an error if they don't
have a type specified.
This is a follow-up to #76184
Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
| Janne Heß | 2022-02-28 | 1 | -1/+1 |
| * | | haskell.compiler: ghc921 -> ghc922•••https://www.haskell.org/ghc/download_ghc_9_2_2.html
| sternenseemann | 2022-03-09 | 1 | -1/+1 |
| |/ |
|
| * | Merge pull request #156503 from hercules-ci/nixos-add-system.build-options•••nixos: Add `system.build.`{`toplevel`,`installBootLoader`}, improve error message | Robert Hensing | 2022-01-25 | 1 | -5/+7 |
| |\ |
|
| | * | lib.modules: Define mergeOneOption in terms of mergeUniqueOption | Robert Hensing | 2022-01-24 | 1 | -5/+1 |