From 7a1054fa5f223126833718fc3f332579dba5f0f7 Mon Sep 17 00:00:00 2001 From: Lunaphied Date: Sun, 17 Mar 2024 18:01:05 -0600 Subject: repl: improve `:doc` builtin repl command to support lambdas. For a long time `nix repl` has supported displaying documentation set on builtins, however, it has long been convention to use Markdown comments on Nix functions themselves for documentation. This exposes that information to `nix repl` users in a nice and formatted way. NixOS/rfcs#145 doc-comments are primarily what this feature is intended to consume, however, support for lambda documentation in the repl is experimental. We do our best effort to support the RFC here. These changes are based on [the nix-doc library](https://github.com/lf-/nix-doc) and are licensed under the terms described in the relevant source files. Change-Id: Ic6fe947d39a22540705d890737e336c4720b0a22 --- package.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'package.nix') diff --git a/package.nix b/package.nix index 1c943e046..ab08add16 100644 --- a/package.nix +++ b/package.nix @@ -43,6 +43,8 @@ busybox-sandbox-shell, + nix-doc, + pname ? "nix", versionSuffix ? "", officialRelease ? true, @@ -186,6 +188,7 @@ in stdenv.mkDerivation (finalAttrs: { lowdown libsodium toml11 + nix-doc ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libseccomp busybox-sandbox-shell ] ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid -- cgit v1.2.3