-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module system: internalise prefix-stripping logic #203994
Commits on Dec 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e0adfa1 - Browse repository at this point
Copy the full SHA e0adfa1View commit details -
lib/generators.toPretty: don't evaluate derivations
With the goal of making `toPretty` suitable for rendering option values, render derivations as `<derivation foo-1.0>` instead of `<derivation /nix/store/…-foo-1.0.drv>`. This is to avoid causing sudden evaluation errors for out-of-tree projects that have options with `default = pkgs.someUnfreePackage;` and no `defaultText`.
Configuration menu - View commit details
-
Copy full SHA for baa1a0c - Browse repository at this point
Copy the full SHA baa1a0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 59bde9a - Browse repository at this point
Copy the full SHA 59bde9aView commit details -
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`.
Configuration menu - View commit details
-
Copy full SHA for 42abb5a - Browse repository at this point
Copy the full SHA 42abb5aView commit details -
lib/trivial: add
manualRevision
This variable is set to "master" on master and "release-YY.DD" on the release branches so that the manual can link to the correct revision.
Configuration menu - View commit details
-
Copy full SHA for e9fe624 - Browse repository at this point
Copy the full SHA e9fe624View commit details -
A generic function to convert a path into a documentation-friendly {path, source, url} triple based on a list of file sources.
Configuration menu - View commit details
-
Copy full SHA for 5fa06d9 - Browse repository at this point
Copy the full SHA 5fa06d9View commit details -
lib/generators.toPretty: add
searchPath
Provides a mechanism for rendering paths relative to a known prefix using angle bracket syntax. Backed by `lib.strings.lookupPrefix`.
Configuration menu - View commit details
-
Copy full SHA for a79632a - Browse repository at this point
Copy the full SHA a79632aView commit details -
module system: internalise prefix-stripping logic
Add an internal `_module.sources` option which specifies a list of sources to be used by `lib.strings.lookupPrefix` to render paths in option values and declarations. The sources always include the `nixpkgsSource`, which links to the manual for `lib.trivial.manualRevision`. Implement this logic in a new `lib.optionsToDocTemplate` function which deprecates `lib.optionAttrSetToDocList`. The returned option declarations are now attrsets as returned by `lookupPrefix`. If `decl.source` is set, then the declaration is rendered using angle bracket syntax: `<${decl.source}/${decl.path}>`. Other consumers are free to treat the source name as they intend. Deprecate `documentation.nixos.extraModuleSources`, converting it to `_module.sources` with `name` set to `_unknown`. We now call `eval-cacheable-options.nix` with a single filtered nixpkgs source, which is easier to maintain than a bunch of paths and allows things to work more smoothly (mainly `lib.trivial.release` can access ../.version, and `lib.nixpkgsSource` works as intended so we don't need to special-case anything).
Configuration menu - View commit details
-
Copy full SHA for b3ab3a4 - Browse repository at this point
Copy the full SHA b3ab3a4View commit details