diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2022-12-25 01:30:47 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2022-12-25 01:30:47 +0100 |
commit | 72c37eddec230b691dee4a6c7aed17028a617ad8 (patch) | |
tree | caf36a6707f07dff9fce175e4fc0f6dd8260a24c /doc | |
parent | 4b4777638c424fa29224330d078b065503806aad (diff) | |
parent | 3fc0495cdc63449e1699db7b377962fb4ae55190 (diff) |
Merge branch 'staging-next' into staging
Diffstat (limited to 'doc')
-rw-r--r-- | doc/build-aux/pandoc-filters/link-unix-man-references.lua | 25 | ||||
-rw-r--r-- | doc/builders/special.xml | 1 | ||||
-rw-r--r-- | doc/builders/special/darwin-builder.section.md | 60 | ||||
-rw-r--r-- | doc/doc-support/default.nix | 18 | ||||
-rw-r--r-- | doc/doc-support/lib-function-docs.nix | 36 | ||||
-rw-r--r-- | doc/doc-support/lib-function-locations.nix | 6 | ||||
-rw-r--r-- | doc/doc-support/parameters.xml | 1 | ||||
-rw-r--r-- | doc/functions/library.xml | 24 | ||||
-rw-r--r-- | doc/languages-frameworks/android.section.md | 1 | ||||
-rw-r--r-- | doc/languages-frameworks/dotnet.section.md | 1 |
10 files changed, 125 insertions, 48 deletions
diff --git a/doc/build-aux/pandoc-filters/link-unix-man-references.lua b/doc/build-aux/pandoc-filters/link-unix-man-references.lua index e437ac73a1cba..b81d4a0979e72 100644 --- a/doc/build-aux/pandoc-filters/link-unix-man-references.lua +++ b/doc/build-aux/pandoc-filters/link-unix-man-references.lua @@ -3,10 +3,31 @@ Turns a manpage reference into a link, when a mapping is defined below. ]] local man_urls = { - ["tmpfiles.d(5)"] = "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html", ["nix.conf(5)"] = "https://nixos.org/manual/nix/stable/#sec-conf-file", - ["systemd.time(7)"] = "https://www.freedesktop.org/software/systemd/man/systemd.time.html", + + ["journald.conf(5)"] = "https://www.freedesktop.org/software/systemd/man/journald.conf.html", + ["logind.conf(5)"] = "https://www.freedesktop.org/software/systemd/man/logind.conf.html", + ["networkd.conf(5)"] = "https://www.freedesktop.org/software/systemd/man/networkd.conf.html", + ["systemd.automount(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.automount.html", + ["systemd.exec(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.exec.html", + ["systemd.link(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.link.html", + ["systemd.mount(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.mount.html", + ["systemd.netdev(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.netdev.html", + ["systemd.network(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.network.html", + ["systemd.nspawn(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.nspawn.html", + ["systemd.path(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.path.html", + ["systemd.resource-control(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html", + ["systemd.scope(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.scope.html", + ["systemd.service(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.service.html", + ["systemd.slice(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.slice.html", + ["systemd.socket(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.socket.html", ["systemd.timer(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.timer.html", + ["systemd.unit(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.unit.html", + ["timesyncd.conf(5)"] = "https://www.freedesktop.org/software/systemd/man/timesyncd.conf.html", + ["tmpfiles.d(5)"] = "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html", + ["systemd.time(7)"] = "https://www.freedesktop.org/software/systemd/man/systemd.time.html", + ["systemd-fstab-generator(8)"] = "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html", + ["systemd-networkd-wait-online.service(8)"] = "https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html", } function Code(elem) diff --git a/doc/builders/special.xml b/doc/builders/special.xml index 8902ce5c81329..525eb71abfe7e 100644 --- a/doc/builders/special.xml +++ b/doc/builders/special.xml @@ -7,4 +7,5 @@ </para> <xi:include href="special/fhs-environments.section.xml" /> <xi:include href="special/mkshell.section.xml" /> + <xi:include href="special/darwin-builder.section.xml" /> </chapter> diff --git a/doc/builders/special/darwin-builder.section.md b/doc/builders/special/darwin-builder.section.md new file mode 100644 index 0000000000000..96b1fcb507f25 --- /dev/null +++ b/doc/builders/special/darwin-builder.section.md @@ -0,0 +1,60 @@ +# darwin.builder {#sec-darwin-builder} + +`darwin.builder` provides a way to bootstrap a Linux builder on a macOS machine. + +This requires macOS version 12.4 or later. + +This also requires that port 22 on your machine is free (since Nix does not +permit specifying a non-default SSH port for builders). + +You will also need to be a trusted user for your Nix installation. In other +words, your `/etc/nix/nix.conf` should have something like: + +``` +extra-trusted-users = <your username goes here> +``` + +To launch the builder, run the following flake: + +```ShellSession +$ nix run nixpkgs#darwin.builder +``` + +That will prompt you to enter your `sudo` password: + +``` ++ sudo --reset-timestamp /nix/store/…-install-credentials.sh ./keys +Password: +``` + +… so that it can install a private key used to `ssh` into the build server. +After that the script will launch the virtual machine: + +``` +<<< Welcome to NixOS 22.11.20220901.1bd8d11 (aarch64) - ttyAMA0 >>> + +Run 'nixos-help' for the NixOS manual. + +nixos login: +``` + +> Note: When you need to stop the VM, type `Ctrl`-`a` + `c` to open the `qemu` +> prompt and then type `quit` followed by `Enter` + +To delegate builds to the remote builder, add the following options to your +`nix.conf` file: + +``` +# - Replace ${ARCH} with either aarch64 or x86_64 to match your host machine +# - Replace ${MAX_JOBS} with the maximum number of builds (pick 4 if you're not sure) +builders = ssh-ng://builder@localhost ${ARCH}-linux /etc/nix/builder_ed25519 ${MAX_JOBS} - - - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo=' + +# Not strictly necessary, but this will reduce your disk utilization +builders-use-substitutes = true +``` + +… and then restart your Nix daemon to apply the change: + +```ShellSession +$ sudo launchctl kickstart -k system/org.nixos.nix-daemon +``` diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix index 429c7a5fbe800..ec180064c35d8 100644 --- a/doc/doc-support/default.nix +++ b/doc/doc-support/default.nix @@ -3,8 +3,22 @@ let inherit (pkgs) lib; inherit (lib) hasPrefix removePrefix; - locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; }; - functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; }; + libsets = [ + { name = "asserts"; description = "assertion functions"; } + { name = "attrsets"; description = "attribute set functions"; } + { name = "strings"; description = "string manipulation functions"; } + { name = "versions"; description = "version string functions"; } + { name = "trivial"; description = "miscellaneous functions"; } + { name = "lists"; description = "list manipulation functions"; } + { name = "debug"; description = "debugging functions"; } + { name = "options"; description = "NixOS / nixpkgs option handling"; } + { name = "filesystem"; description = "filesystem functions"; } + { name = "sources"; description = "source filtering functions"; } + { name = "cli"; description = "command-line serialization functions"; } + ]; + + locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs libsets; }; + functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs libsets; }; version = pkgs.lib.version; epub-xsl = pkgs.writeText "epub.xsl" '' diff --git a/doc/doc-support/lib-function-docs.nix b/doc/doc-support/lib-function-docs.nix index 4e67609e23fb2..d6fa08aa96205 100644 --- a/doc/doc-support/lib-function-docs.nix +++ b/doc/doc-support/lib-function-docs.nix @@ -1,30 +1,32 @@ -# Generates the documentation for library functions via nixdoc. To add -# another library function file to this list, the include list in the -# file `doc/functions/library.xml` must also be updated. +# Generates the documentation for library functions via nixdoc. -{ pkgs ? import ./.. {}, locationsXml }: +{ pkgs, locationsXml, libsets }: with pkgs; stdenv.mkDerivation { name = "nixpkgs-lib-docs"; - src = ./../../lib; + src = ../../lib; buildInputs = [ nixdoc ]; installPhase = '' function docgen { - nixdoc -c "$1" -d "$2" -f "../lib/$1.nix" > "$out/$1.xml" + # TODO: wrap lib.$1 in <literal>, make nixdoc not escape it + nixdoc -c "$1" -d "lib.$1: $2" -f "$1.nix" > "$out/$1.xml" + echo "<xi:include href='$1.xml' />" >> "$out/index.xml" } - mkdir -p $out - ln -s ${locationsXml} $out/locations.xml + mkdir -p "$out" + + cat > "$out/index.xml" << 'EOF' + <?xml version="1.0" encoding="utf-8"?> + <root xmlns:xi="http://www.w3.org/2001/XInclude"> + EOF + + ${lib.concatMapStrings ({ name, description }: '' + docgen ${name} ${lib.escapeShellArg description} + '') libsets} - docgen asserts 'Assert functions' - docgen attrsets 'Attribute-set functions' - docgen strings 'String manipulation functions' - docgen trivial 'Miscellaneous functions' - docgen lists 'List manipulation functions' - docgen debug 'Debugging functions' - docgen options 'NixOS / nixpkgs option handling' - docgen filesystem 'Filesystem functions' - docgen sources 'Source filtering functions' + echo "</root>" >> "$out/index.xml" + + ln -s ${locationsXml} $out/locations.xml ''; } diff --git a/doc/doc-support/lib-function-locations.nix b/doc/doc-support/lib-function-locations.nix index 68edd27098543..ae1123c63ad30 100644 --- a/doc/doc-support/lib-function-locations.nix +++ b/doc/doc-support/lib-function-locations.nix @@ -1,4 +1,4 @@ -{ pkgs ? (import ./.. { }), nixpkgs ? { }}: +{ pkgs, nixpkgs ? { }, libsets }: let revision = pkgs.lib.trivial.revisionWithDefault (nixpkgs.revision or "master"); @@ -16,9 +16,7 @@ let subsetname = subsetname; functions = libDefPos toplib.${subsetname}; }) - (builtins.filter - (name: builtins.isAttrs toplib.${name}) - (builtins.attrNames toplib)); + (builtins.map (x: x.name) libsets); nixpkgsLib = pkgs.lib; diff --git a/doc/doc-support/parameters.xml b/doc/doc-support/parameters.xml index 50ff25fe10750..5b39d2f7f1a58 100644 --- a/doc/doc-support/parameters.xml +++ b/doc/doc-support/parameters.xml @@ -11,6 +11,7 @@ <xsl:param name="html.script" select="'./highlightjs/highlight.pack.js ./highlightjs/loader.js'" /> <xsl:param name="xref.with.number.and.title" select="0" /> <xsl:param name="use.id.as.filename" select="1" /> + <xsl:param name="generate.section.toc.level" select="1" /> <xsl:param name="toc.section.depth" select="0" /> <xsl:param name="admon.style" select="''" /> <xsl:param name="callout.graphics.extension" select="'.svg'" /> diff --git a/doc/functions/library.xml b/doc/functions/library.xml index 0a8bae229f261..788ea0b94f1fe 100644 --- a/doc/functions/library.xml +++ b/doc/functions/library.xml @@ -8,25 +8,7 @@ Nixpkgs provides a standard library at <varname>pkgs.lib</varname>, or through <code>import <nixpkgs/lib></code>. </para> -<!-- These docs are generated via nixdoc. To add another generated - library function file to this list, the file - `lib-function-docs.nix` must also be updated. --> - - <xi:include href="./library/generated/asserts.xml" /> - - <xi:include href="./library/generated/attrsets.xml" /> - - <xi:include href="./library/generated/strings.xml" /> - - <xi:include href="./library/generated/trivial.xml" /> - - <xi:include href="./library/generated/lists.xml" /> - - <xi:include href="./library/generated/debug.xml" /> - - <xi:include href="./library/generated/options.xml" /> - - <xi:include href="./library/generated/filesystem.xml" /> - - <xi:include href="./library/generated/sources.xml" /> + <!-- The index must have a root element to declare namespaces, but we + don't want to include it, so we select all of its children. --> + <xi:include href="./library/generated/index.xml" xpointer="xpointer(/root/*)" /> </section> diff --git a/doc/languages-frameworks/android.section.md b/doc/languages-frameworks/android.section.md index 28128ead6631d..15b8d3839b193 100644 --- a/doc/languages-frameworks/android.section.md +++ b/doc/languages-frameworks/android.section.md @@ -232,7 +232,6 @@ androidenv.emulateApp { platformVersion = "24"; abiVersion = "armeabi-v7a"; # mips, x86, x86_64 systemImageType = "default"; - useGoogleAPIs = false; app = ./MyApp.apk; package = "MyApp"; activity = "MainActivity"; diff --git a/doc/languages-frameworks/dotnet.section.md b/doc/languages-frameworks/dotnet.section.md index 1baa135ae5866..bfb193b1f021a 100644 --- a/doc/languages-frameworks/dotnet.section.md +++ b/doc/languages-frameworks/dotnet.section.md @@ -121,7 +121,6 @@ in buildDotnetModule rec { dotnet-sdk = dotnetCorePackages.sdk_3_1; dotnet-runtime = dotnetCorePackages.net_5_0; - dotnetFlags = [ "--runtime linux-x64" ]; executables = [ "foo" ]; # This wraps "$out/lib/$pname/foo" to `$out/bin/foo`. executables = []; # Don't install any executables. |