···11---[[
22-Converts Code AST nodes produced by pandoc’s DocBook reader
33-from citerefentry elements into AST for corresponding role
44-for reStructuredText.
55-66-We use subset of MyST syntax (CommonMark with features from rST)
77-so let’s use the rST AST for rST features.
88-99-Reference: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage
1010-]]
1111-1212-function Code(elem)
1313- elem.classes = elem.classes:map(function (x)
1414- if x == 'citerefentry' then
1515- elem.attributes['role'] = 'manpage'
1616- return 'interpreted-text'
1717- else
1818- return x
1919- end
2020- end)
2121-2222- return elem
2323-end
···11---[[
22-Converts Link AST nodes with empty label to DocBook xref elements.
33-44-This is a temporary script to be able use cross-references conveniently
55-using syntax taken from MyST, while we still use docbook-xsl
66-for generating the documentation.
77-88-Reference: https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing
99-]]
1010-1111-local function starts_with(start, str)
1212- return str:sub(1, #start) == start
1313-end
1414-1515-local function escape_xml_arg(arg)
1616- amps = arg:gsub('&', '&')
1717- amps_quotes = amps:gsub('"', '"')
1818- amps_quotes_lt = amps_quotes:gsub('<', '<')
1919-2020- return amps_quotes_lt
2121-end
2222-2323-function Link(elem)
2424- has_no_content = #elem.content == 0
2525- targets_anchor = starts_with('#', elem.target)
2626- has_no_attributes = elem.title == '' and elem.identifier == '' and #elem.classes == 0 and #elem.attributes == 0
2727-2828- if has_no_content and targets_anchor and has_no_attributes then
2929- -- xref expects idref without the pound-sign
3030- target_without_hash = elem.target:sub(2, #elem.target)
3131-3232- return pandoc.RawInline('docbook', '<xref linkend="' .. escape_xml_arg(target_without_hash) .. '" />')
3333- end
3434-end
···11---[[
22-Converts AST for reStructuredText roles into corresponding
33-DocBook elements.
44-55-Currently, only a subset of roles is supported.
66-77-Reference:
88- List of roles:
99- https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
1010- manpage:
1111- https://tdg.docbook.org/tdg/5.1/citerefentry.html
1212- file:
1313- https://tdg.docbook.org/tdg/5.1/filename.html
1414-]]
1515-1616-function Code(elem)
1717- if elem.classes:includes('interpreted-text') then
1818- local tag = nil
1919- local content = elem.text
2020- if elem.attributes['role'] == 'manpage' then
2121- tag = 'citerefentry'
2222- local title, volnum = content:match('^(.+)%((%w+)%)$')
2323- if title == nil then
2424- -- No volnum in parentheses.
2525- title = content
2626- end
2727- content = '<refentrytitle>' .. title .. '</refentrytitle>' .. (volnum ~= nil and ('<manvolnum>' .. volnum .. '</manvolnum>') or '')
2828- elseif elem.attributes['role'] == 'file' then
2929- tag = 'filename'
3030- elseif elem.attributes['role'] == 'command' then
3131- tag = 'command'
3232- elseif elem.attributes['role'] == 'option' then
3333- tag = 'option'
3434- elseif elem.attributes['role'] == 'var' then
3535- tag = 'varname'
3636- elseif elem.attributes['role'] == 'env' then
3737- tag = 'envar'
3838- end
3939-4040- if tag ~= nil then
4141- return pandoc.RawInline('docbook', '<' .. tag .. '>' .. content .. '</' .. tag .. '>')
4242- end
4343- end
4444-end
-28
doc/build-aux/pandoc-filters/link-manpages.nix
···11-{ pkgs ? import ../../.. {} }:
22-let
33- inherit (pkgs) lib;
44- manpageURLs = lib.importJSON (pkgs.path + "/doc/manpage-urls.json");
55-in pkgs.writeText "link-manpages.lua" ''
66- --[[
77- Adds links to known man pages that aren't already in a link.
88- ]]
99-1010- local manpage_urls = {
1111- ${lib.concatStringsSep "\n" (lib.mapAttrsToList (man: url:
1212- " [${builtins.toJSON man}] = ${builtins.toJSON url},") manpageURLs)}
1313- }
1414-1515- traverse = 'topdown'
1616-1717- -- Returning false as the second value aborts processing of child elements.
1818- function Link(elem)
1919- return elem, false
2020- end
2121-2222- function Code(elem)
2323- local is_man_role = elem.classes:includes('interpreted-text') and elem.attributes['role'] == 'manpage'
2424- if is_man_role and manpage_urls[elem.text] ~= nil then
2525- return pandoc.Link(elem, manpage_urls[elem.text]), false
2626- end
2727- end
2828-''
···11---[[
22-Replaces Str AST nodes containing {role}, followed by a Code node
33-by a Code node with attrs that would be produced by rST reader
44-from the role syntax.
55-66-This is to emulate MyST syntax in Pandoc.
77-(MyST is a CommonMark flavour with rST features mixed in.)
88-99-Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
1010-]]
1111-1212-function Inlines(inlines)
1313- for i = #inlines-1,1,-1 do
1414- local first = inlines[i]
1515- local second = inlines[i+1]
1616- local correct_tags = first.tag == 'Str' and second.tag == 'Code'
1717- if correct_tags then
1818- -- docutils supports alphanumeric strings separated by [-._:]
1919- -- We are slightly more liberal for simplicity.
2020- -- Allow preceding punctuation (eg '('), otherwise '({file}`...`)'
2121- -- does not match. Also allow anything followed by a non-breaking space
2222- -- since pandoc emits those after certain abbreviations (e.g. e.g.).
2323- local prefix, role = first.text:match('^(.*){([-._+:%w]+)}$')
2424- if role ~= nil and (prefix == '' or prefix:match("^.*[%p ]$") ~= nil) then
2525- if prefix == '' then
2626- inlines:remove(i)
2727- else
2828- first.text = prefix
2929- end
3030- second.attributes['role'] = role
3131- second.classes:insert('interpreted-text')
3232- end
3333- end
3434- end
3535- return inlines
3636-end
···11---[[
22-Replaces Code nodes with attrs that would be produced by rST reader
33-from the role syntax by a Str AST node containing {role}, followed by a Code node.
44-55-This is to emulate MyST syntax in Pandoc.
66-(MyST is a CommonMark flavour with rST features mixed in.)
77-88-Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
99-]]
1010-1111-function Code(elem)
1212- local role = elem.attributes['role']
1313-1414- if elem.classes:includes('interpreted-text') and role ~= nil then
1515- elem.classes = elem.classes:filter(function (c)
1616- return c ~= 'interpreted-text'
1717- end)
1818- elem.attributes['role'] = nil
1919-2020- return {
2121- pandoc.Str('{' .. role .. '}'),
2222- elem,
2323- }
2424- end
2525-end
···11# DLib {#dlib}
2233-[DLib](http://dlib.net/) is a modern, C++-based toolkit which provides several machine learning algorithms.
33+[DLib](http://dlib.net/) is a modern, C++\-based toolkit which provides several machine learning algorithms.
4455## Compiling without AVX support {#compiling-without-avx-support}
66
+27
doc/builders/packages/index.md
···11+# Packages {#chap-packages}
22+33+This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
44+55+```{=include=} sections
66+citrix.section.md
77+dlib.section.md
88+eclipse.section.md
99+elm.section.md
1010+emacs.section.md
1111+firefox.section.md
1212+fish.section.md
1313+fuse.section.md
1414+ibus.section.md
1515+kakoune.section.md
1616+linux.section.md
1717+locales.section.md
1818+etc-files.section.md
1919+nginx.section.md
2020+opengl.section.md
2121+shell-helpers.section.md
2222+steam.section.md
2323+cataclysm-dda.section.md
2424+urxvt.section.md
2525+weechat.section.md
2626+xorg.section.md
2727+```
-29
doc/builders/packages/index.xml
···11-<chapter xmlns="http://docbook.org/ns/docbook"
22- xmlns:xi="http://www.w3.org/2001/XInclude"
33- xml:id="chap-packages">
44- <title>Packages</title>
55- <para>
66- This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
77- </para>
88- <xi:include href="citrix.section.xml" />
99- <xi:include href="dlib.section.xml" />
1010- <xi:include href="eclipse.section.xml" />
1111- <xi:include href="elm.section.xml" />
1212- <xi:include href="emacs.section.xml" />
1313- <xi:include href="firefox.section.xml" />
1414- <xi:include href="fish.section.xml" />
1515- <xi:include href="fuse.section.xml" />
1616- <xi:include href="ibus.section.xml" />
1717- <xi:include href="kakoune.section.xml" />
1818- <xi:include href="linux.section.xml" />
1919- <xi:include href="locales.section.xml" />
2020- <xi:include href="etc-files.section.xml" />
2121- <xi:include href="nginx.section.xml" />
2222- <xi:include href="opengl.section.xml" />
2323- <xi:include href="shell-helpers.section.xml" />
2424- <xi:include href="steam.section.xml" />
2525- <xi:include href="cataclysm-dda.section.xml" />
2626- <xi:include href="urxvt.section.xml" />
2727- <xi:include href="weechat.section.xml" />
2828- <xi:include href="xorg.section.xml" />
2929-</chapter>
+11
doc/builders/special.md
···11+# Special builders {#chap-special}
22+33+This chapter describes several special builders.
44+55+```{=include=} sections
66+special/fhs-environments.section.md
77+special/makesetuphook.section.md
88+special/mkshell.section.md
99+special/darwin-builder.section.md
1010+special/vm-tools.section.md
1111+```
···214214- Hydra builds for master and staging should not be used as testing platform, it’s a build farm for changes that have been already tested.
215215- When changing the bootloader installation process, extra care must be taken. Grub installations cannot be rolled back, hence changes may break people’s installations forever. For any non-trivial change to the bootloader please file a PR asking for review, especially from \@edolstra.
216216217217-```{.graphviz caption="Staging workflow"}
218218-digraph {
219219- "small changes" [shape=none]
220220- "mass-rebuilds and other large changes" [shape=none]
221221- "critical security fixes" [shape=none]
222222- "broken staging-next fixes" [shape=none]
223223-224224- "small changes" -> master
225225- "mass-rebuilds and other large changes" -> staging
226226- "critical security fixes" -> master
227227- "broken staging-next fixes" -> "staging-next"
228228-229229- "staging-next" -> master [color="#E85EB0"] [label="stabilization ends"] [fontcolor="#E85EB0"]
230230- "staging" -> "staging-next" [color="#E85EB0"] [label="stabilization starts"] [fontcolor="#E85EB0"]
231231-232232- master -> "staging-next" -> staging [color="#5F5EE8"] [label="every six hours (GitHub Action)"] [fontcolor="#5F5EE8"]
233233-}
234234-```
217217+::: {.figure #fig-staging-workflow}
218218+# Staging workflow
219219+<!-- generated from ./staging-workflow.dot using: dot -Tsvg staging-workflow.dot > staging-workflow.svg -->
220220+
221221+:::
235222236223[This GitHub Action](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/periodic-merge-6h.yml) brings changes from `master` to `staging-next` and from `staging-next` to `staging` every 6 hours; these are the blue arrows in the diagram above. The purple arrows in the diagram above are done manually and much less frequently. You can get an idea of how often these merges occur by looking at the git history.
237224
+119-43
doc/default.nix
···11{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
22let
33- doc-support = import ./doc-support { inherit pkgs nixpkgs; };
33+ inherit (pkgs) lib;
44+ inherit (lib) hasPrefix removePrefix;
55+66+ lib-docs = import ./doc-support/lib-function-docs.nix {
77+ inherit pkgs nixpkgs;
88+ libsets = [
99+ { name = "asserts"; description = "assertion functions"; }
1010+ { name = "attrsets"; description = "attribute set functions"; }
1111+ { name = "strings"; description = "string manipulation functions"; }
1212+ { name = "versions"; description = "version string functions"; }
1313+ { name = "trivial"; description = "miscellaneous functions"; }
1414+ { name = "lists"; description = "list manipulation functions"; }
1515+ { name = "debug"; description = "debugging functions"; }
1616+ { name = "options"; description = "NixOS / nixpkgs option handling"; }
1717+ { name = "path"; description = "path functions"; }
1818+ { name = "filesystem"; description = "filesystem functions"; }
1919+ { name = "sources"; description = "source filtering functions"; }
2020+ { name = "cli"; description = "command-line serialization functions"; }
2121+ ];
2222+ };
2323+2424+ epub = pkgs.runCommand "manual.epub" {
2525+ nativeBuildInputs = with pkgs; [ libxslt zip ];
2626+2727+ epub = ''
2828+ <book xmlns="http://docbook.org/ns/docbook"
2929+ xmlns:xlink="http://www.w3.org/1999/xlink"
3030+ version="5.0"
3131+ xml:id="nixpkgs-manual">
3232+ <info>
3333+ <title>Nixpkgs Manual</title>
3434+ <subtitle>Version ${pkgs.lib.version}</subtitle>
3535+ </info>
3636+ <chapter>
3737+ <title>Temporarily unavailable</title>
3838+ <para>
3939+ The Nixpkgs manual is currently not available in EPUB format,
4040+ please use the <link xlink:href="https://nixos.org/nixpkgs/manual">HTML manual</link>
4141+ instead.
4242+ </para>
4343+ <para>
4444+ If you've used the EPUB manual in the past and it has been useful to you, please
4545+ <link xlink:href="https://github.com/NixOS/nixpkgs/issues/237234">let us know</link>.
4646+ </para>
4747+ </chapter>
4848+ </book>
4949+ '';
5050+5151+ passAsFile = [ "epub" ];
5252+ } ''
5353+ mkdir scratch
5454+ xsltproc \
5555+ --param chapter.autolabel 0 \
5656+ --nonet \
5757+ --output scratch/ \
5858+ ${pkgs.docbook_xsl_ns}/xml/xsl/docbook/epub/docbook.xsl \
5959+ $epubPath
6060+6161+ echo "application/epub+zip" > mimetype
6262+ zip -0Xq "$out" mimetype
6363+ cd scratch && zip -Xr9D "$out" *
6464+ '';
6565+6666+ # NB: This file describes the Nixpkgs manual, which happens to use module
6767+ # docs infra originally developed for NixOS.
6868+ optionsDoc = pkgs.nixosOptionsDoc {
6969+ inherit (pkgs.lib.evalModules {
7070+ modules = [ ../pkgs/top-level/config.nix ];
7171+ class = "nixpkgsConfig";
7272+ }) options;
7373+ documentType = "none";
7474+ transformOptions = opt:
7575+ opt // {
7676+ declarations =
7777+ map
7878+ (decl:
7979+ if hasPrefix (toString ../..) (toString decl)
8080+ then
8181+ let subpath = removePrefix "/" (removePrefix (toString ../.) (toString decl));
8282+ in { url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; name = subpath; }
8383+ else decl)
8484+ opt.declarations;
8585+ };
8686+ };
487in pkgs.stdenv.mkDerivation {
588 name = "nixpkgs-manual";
689790 nativeBuildInputs = with pkgs; [
88- pandoc
99- graphviz
1010- libxml2
1111- libxslt
1212- zip
1313- jing
1414- xmlformat
9191+ nixos-render-docs
1592 ];
16931717- src = pkgs.nix-gitignore.gitignoreSource [] ./.;
9494+ src = ./.;
18951996 postPatch = ''
2020- ln -s ${doc-support} ./doc-support/result
9797+ ln -s ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./config-options.json
2198 '';
22992323- epub = ''
2424- <book xmlns="http://docbook.org/ns/docbook"
2525- xmlns:xlink="http://www.w3.org/1999/xlink"
2626- version="5.0"
2727- xml:id="nixpkgs-manual">
2828- <info>
2929- <title>Nixpkgs Manual</title>
3030- <subtitle>Version ${pkgs.lib.version}</subtitle>
3131- </info>
3232- <chapter>
3333- <title>Temporarily unavailable</title>
3434- <para>
3535- The Nixpkgs manual is currently not available in EPUB format,
3636- please use the <link xlink:href="https://nixos.org/nixpkgs/manual">HTML manual</link>
3737- instead.
3838- </para>
3939- <para>
4040- If you've used the EPUB manual in the past and it has been useful to you, please
4141- <link xlink:href="https://github.com/NixOS/nixpkgs/issues/237234">let us know</link>.
4242- </para>
4343- </chapter>
4444- </book>
4545- '';
4646- passAsFile = [ "epub" ];
100100+ buildPhase = ''
101101+ cat \
102102+ ./functions/library.md.in \
103103+ ${lib-docs}/index.md \
104104+ > ./functions/library.md
105105+ substitute ./manual.md.in ./manual.md \
106106+ --replace '@MANUAL_VERSION@' '${pkgs.lib.version}'
107107+108108+ mkdir -p out/media
109109+110110+ mkdir -p out/highlightjs
111111+ cp -t out/highlightjs \
112112+ ${pkgs.documentation-highlighter}/highlight.pack.js \
113113+ ${pkgs.documentation-highlighter}/LICENSE \
114114+ ${pkgs.documentation-highlighter}/mono-blue.css \
115115+ ${pkgs.documentation-highlighter}/loader.js
116116+117117+ cp -t out ./overrides.css ./style.css
471184848- preBuild = ''
4949- cp $epubPath epub.xml
5050- make -j$NIX_BUILD_CORES render-md
119119+ nixos-render-docs manual html \
120120+ --manpage-urls ./manpage-urls.json \
121121+ --revision ${pkgs.lib.trivial.revisionWithDefault (pkgs.rev or "master")} \
122122+ --stylesheet style.css \
123123+ --stylesheet overrides.css \
124124+ --stylesheet highlightjs/mono-blue.css \
125125+ --script ./highlightjs/highlight.pack.js \
126126+ --script ./highlightjs/loader.js \
127127+ --toc-depth 1 \
128128+ --section-toc-depth 1 \
129129+ manual.md \
130130+ out/index.html
51131 '';
5213253133 installPhase = ''
54134 dest="$out/share/doc/nixpkgs"
55135 mkdir -p "$(dirname "$dest")"
5656- mv out/html "$dest"
136136+ mv out "$dest"
57137 mv "$dest/index.html" "$dest/manual.html"
581385959- mv out/epub/manual.epub "$dest/nixpkgs-manual.epub"
139139+ cp ${epub} "$dest/nixpkgs-manual.epub"
6014061141 mkdir -p $out/nix-support/
62142 echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products
63143 echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products
64144 '';
6565-6666- # Environment variables
6767- PANDOC_LUA_FILTERS_DIR = "${pkgs.pandoc-lua-filters}/share/pandoc/filters";
6868- PANDOC_LINK_MANPAGES_FILTER = import build-aux/pandoc-filters/link-manpages.nix { inherit pkgs; };
69145}
···11+# Nixpkgs Library Functions {#sec-functions-library}
22+33+Nixpkgs provides a standard library at `pkgs.lib`, or through `import <nixpkgs/lib>`.
44+55+<!-- nixdoc-generated documentation must be appended here during build! -->
-14
doc/functions/library.xml
···11-<section xmlns="http://docbook.org/ns/docbook"
22- xmlns:xlink="http://www.w3.org/1999/xlink"
33- xmlns:xi="http://www.w3.org/2001/XInclude"
44- xml:id="sec-functions-library">
55- <title>Nixpkgs Library Functions</title>
66-77- <para>
88- Nixpkgs provides a standard library at <varname>pkgs.lib</varname>, or through <code>import <nixpkgs/lib></code>.
99- </para>
1010-1111- <!-- The index must have a root element to declare namespaces, but we
1212- don't want to include it, so we select all of its children. -->
1313- <xi:include href="./library/generated/index.xml" xpointer="xpointer(/root/*)" />
1414-</section>
+33
doc/hooks/index.md
···11+# Hooks reference {#chap-hooks}
22+33+Nixpkgs has several hook packages that augment the stdenv phases.
44+55+The stdenv built-in hooks are documented in [](#ssec-setup-hooks).
66+77+```{=include=} sections
88+autoconf.section.md
99+automake.section.md
1010+autopatchelf.section.md
1111+breakpoint.section.md
1212+cmake.section.md
1313+gdk-pixbuf.section.md
1414+ghc.section.md
1515+gnome.section.md
1616+installShellFiles.section.md
1717+libiconv.section.md
1818+libxml2.section.md
1919+meson.section.md
2020+ninja.section.md
2121+patch-rc-path-hooks.section.md
2222+perl.section.md
2323+pkg-config.section.md
2424+postgresql-test-hook.section.md
2525+python.section.md
2626+qt-4.section.md
2727+scons.section.md
2828+tetex-tex-live.section.md
2929+unzip.section.md
3030+validatePkgConfig.section.md
3131+waf.section.md
3232+xcbuild.section.md
3333+```
···11+# Languages and frameworks {#chap-language-support}
22+33+The [standard build environment](#chap-stdenv) makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accommodated by overriding the appropriate phases of `stdenv`. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.
44+55+```{=include=} sections
66+agda.section.md
77+android.section.md
88+beam.section.md
99+bower.section.md
1010+chicken.section.md
1111+coq.section.md
1212+crystal.section.md
1313+cuda.section.md
1414+cuelang.section.md
1515+dart.section.md
1616+dhall.section.md
1717+dotnet.section.md
1818+emscripten.section.md
1919+gnome.section.md
2020+go.section.md
2121+haskell.section.md
2222+hy.section.md
2323+idris.section.md
2424+ios.section.md
2525+java.section.md
2626+javascript.section.md
2727+lisp.section.md
2828+lua.section.md
2929+maven.section.md
3030+nim.section.md
3131+ocaml.section.md
3232+octave.section.md
3333+perl.section.md
3434+php.section.md
3535+pkg-config.section.md
3636+python.section.md
3737+qt.section.md
3838+r.section.md
3939+ruby.section.md
4040+rust.section.md
4141+swift.section.md
4242+texlive.section.md
4343+titanium.section.md
4444+vim.section.md
4545+```
-47
doc/languages-frameworks/index.xml
···11-<chapter xmlns="http://docbook.org/ns/docbook"
22- xmlns:xi="http://www.w3.org/2001/XInclude"
33- xml:id="chap-language-support">
44- <title>Languages and frameworks</title>
55- <para>
66- The <link linkend="chap-stdenv">standard build environment</link> makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accommodated by overriding the appropriate phases of <literal>stdenv</literal>. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.
77- </para>
88- <xi:include href="agda.section.xml" />
99- <xi:include href="android.section.xml" />
1010- <xi:include href="beam.section.xml" />
1111- <xi:include href="bower.section.xml" />
1212- <xi:include href="chicken.section.xml" />
1313- <xi:include href="coq.section.xml" />
1414- <xi:include href="crystal.section.xml" />
1515- <xi:include href="cuda.section.xml" />
1616- <xi:include href="cuelang.section.xml" />
1717- <xi:include href="dart.section.xml" />
1818- <xi:include href="dhall.section.xml" />
1919- <xi:include href="dotnet.section.xml" />
2020- <xi:include href="emscripten.section.xml" />
2121- <xi:include href="gnome.section.xml" />
2222- <xi:include href="go.section.xml" />
2323- <xi:include href="haskell.section.xml" />
2424- <xi:include href="hy.section.xml" />
2525- <xi:include href="idris.section.xml" />
2626- <xi:include href="ios.section.xml" />
2727- <xi:include href="java.section.xml" />
2828- <xi:include href="javascript.section.xml" />
2929- <xi:include href="lisp.section.xml" />
3030- <xi:include href="lua.section.xml" />
3131- <xi:include href="maven.section.xml" />
3232- <xi:include href="nim.section.xml" />
3333- <xi:include href="ocaml.section.xml" />
3434- <xi:include href="octave.section.xml" />
3535- <xi:include href="perl.section.xml" />
3636- <xi:include href="php.section.xml" />
3737- <xi:include href="pkg-config.section.xml" />
3838- <xi:include href="python.section.xml" />
3939- <xi:include href="qt.section.xml" />
4040- <xi:include href="r.section.xml" />
4141- <xi:include href="ruby.section.xml" />
4242- <xi:include href="rust.section.xml" />
4343- <xi:include href="swift.section.xml" />
4444- <xi:include href="texlive.section.xml" />
4545- <xi:include href="titanium.section.xml" />
4646- <xi:include href="vim.section.xml" />
4747-</chapter>
···464464465465If the returned array contains exactly one object (e.g. `[{}]`), all values are optional and will be determined automatically.
466466467467-```{=docbook}
468468-<example>
469469-<title>Standard output of an update script using commit feature</title>
470470-```
467467+::: {.example #var-passthru-updateScript-example-commit}
468468+# Standard output of an update script using commit feature
471469472470```json
473471[
···481479 }
482480]
483481```
484484-485485-```{=docbook}
486486-</example>
487487-```
482482+:::
488483489484### Recursive attributes in `mkDerivation` {#mkderivation-recursive-attributes}
490485
+7
doc/using-nixpkgs.md
···11+# Using Nixpkgs {#part-using}
22+33+```{=include=} chapters
44+using/configuration.chapter.md
55+using/overlays.chapter.md
66+using/overrides.chapter.md
77+```
+4-2
doc/using/configuration.chapter.md
···185185186186The following attributes can be passed in [`config`](#chap-packageconfig).
187187188188-```{=docbook}
189189-<include xmlns="http://www.w3.org/2001/XInclude" href="../doc-support/result/config-options.docbook.xml"/>
188188+```{=include=} options
189189+id-prefix: opt-
190190+list-id: configuration-variable-list
191191+source: ../config-options.json
190192```
191193192194
···296296 packages = mkOption {
297297 type = types.listOf types.path;
298298 default = [];
299299- visible = false;
300299 description = lib.mdDoc ''
301300 *This will only be used when systemd is used in stage 1.*
302301···311310 binPackages = mkOption {
312311 type = types.listOf types.path;
313312 default = [];
314314- visible = false;
315313 description = lib.mdDoc ''
316314 *This will only be used when systemd is used in stage 1.*
317315
+1-1
nixos/modules/services/misc/nix-daemon.nix
···656656 to view the current value. By default it is empty.
657657658658 Nix configurations defined under {option}`nix.*` will be translated and applied to this
659659- option. In addition, configuration specified in {option}`nix.extraOptions` which will be appended
659659+ option. In addition, configuration specified in {option}`nix.extraOptions` will be appended
660660 verbatim to the resulting config file.
661661 '';
662662 };
+19-1
nixos/modules/services/misc/ntfy-sh.nix
···3232 };
33333434 settings = mkOption {
3535- type = types.submodule { freeformType = settingsFormat.type; };
3535+ type = types.submodule {
3636+ freeformType = settingsFormat.type;
3737+ options = {
3838+ base-url = mkOption {
3939+ type = types.str;
4040+ example = "https://ntfy.example";
4141+ description = lib.mdDoc ''
4242+ Public facing base URL of the service
4343+4444+ This setting is required for any of the following features:
4545+ - attachments (to return a download URL)
4646+ - e-mail sending (for the topic URL in the email footer)
4747+ - iOS push notifications for self-hosted servers
4848+ (to calculate the Firebase poll_request topic)
4949+ - Matrix Push Gateway (to validate that the pushkey is correct)
5050+ '';
5151+ };
5252+ };
5353+ };
36543755 default = { };
3856
···7777 };
7878 };
79798080+ secretFile = mkOption {
8181+ type = with types; nullOr path;
8282+ default = null;
8383+ description = lib.mdDoc "Path to a secret JSON configuration file which is merged at runtime with the one generated from {option}`services.lemmy.settings`.";
8484+ };
8085 };
81868287 config =
···197202 }
198203 ];
199204200200- systemd.services.lemmy = {
205205+ systemd.services.lemmy = let
206206+ configFile = settingsFormat.generate "config.hjson" cfg.settings;
207207+ mergedConfig = "/run/lemmy/config.hjson";
208208+ in {
201209 description = "Lemmy server";
202210203211 environment = {
204204- LEMMY_CONFIG_LOCATION = "${settingsFormat.generate "config.hjson" cfg.settings}";
212212+ LEMMY_CONFIG_LOCATION = if cfg.secretFile == null then configFile else mergedConfig;
205213 LEMMY_DATABASE_URL = if cfg.database.uri != null then cfg.database.uri else (mkIf (cfg.database.createLocally) "postgres:///lemmy?host=/run/postgresql&user=lemmy");
206214 };
207215···216224217225 requires = lib.optionals cfg.database.createLocally [ "postgresql.service" ];
218226227227+ path = mkIf (cfg.secretFile != null) [ pkgs.jq ];
228228+229229+ # merge the two configs and prevent others from reading the result
230230+ # if somehow $CREDENTIALS_DIRECTORY is not set we fail
231231+ preStart = mkIf (cfg.secretFile != null) ''
232232+ set -u
233233+ umask 177
234234+ jq --slurp '.[0] * .[1]' ${lib.escapeShellArg configFile} "$CREDENTIALS_DIRECTORY/secretFile" > ${lib.escapeShellArg mergedConfig}
235235+ '';
236236+219237 serviceConfig = {
220238 DynamicUser = true;
221239 RuntimeDirectory = "lemmy";
222240 ExecStart = "${cfg.server.package}/bin/lemmy_server";
241241+ LoadCredential = mkIf (cfg.secretFile != null) "secretFile:${toString cfg.secretFile}";
242242+ PrivateTmp = true;
243243+ MemoryDenyWriteExecute = true;
244244+ NoNewPrivileges = true;
223245 };
224246 };
225247
+6-2
nixos/modules/tasks/bcache.nix
···11{ config, lib, pkgs, ... }:
2233{
44- options.boot.initrd.services.bcache.enable = (lib.mkEnableOption (lib.mdDoc "bcache support in the initrd")) // {
55- visible = false; # only works with systemd stage 1
44+ options.boot.initrd.services.bcache.enable = lib.mkEnableOption (lib.mdDoc "bcache support in the initrd") // {
55+ description = lib.mdDoc ''
66+ *This will only be used when systemd is used in stage 1.*
77+88+ Whether to enable bcache support in the initrd.
99+ '';
610 };
711812 config = {
+6-2
nixos/modules/tasks/lvm.nix
···2525 boot.vdo.enable = mkEnableOption (lib.mdDoc "support for booting from VDOLVs");
2626 };
27272828- options.boot.initrd.services.lvm.enable = (mkEnableOption (lib.mdDoc "enable booting from LVM2 in the initrd")) // {
2929- visible = false;
2828+ options.boot.initrd.services.lvm.enable = mkEnableOption (lib.mdDoc "booting from LVM2 in the initrd") // {
2929+ description = lib.mdDoc ''
3030+ *This will only be used when systemd is used in stage 1.*
3131+3232+ Whether to enable booting from LVM2 in the initrd.
3333+ '';
3034 };
31353236 config = mkMerge [
+6-2
nixos/modules/tasks/swraid.nix
···55in {
6677 options.boot.initrd.services.swraid = {
88- enable = (lib.mkEnableOption (lib.mdDoc "swraid support using mdadm")) // {
99- visible = false; # only has effect when the new stage 1 is in place
88+ enable = lib.mkEnableOption (lib.mdDoc "swraid support using mdadm") // {
99+ description = ''
1010+ *This will only be used when systemd is used in stage 1.*
1111+1212+ Whether to enable swraid support using mdadm.
1313+ '';
1014 };
11151216 mdadmConf = lib.mkOption {
+16-2
nixos/tests/lemmy.nix
···2222 # Without setup, the /feeds/* and /nodeinfo/* API endpoints won't return 200
2323 setup = {
2424 admin_username = "mightyiam";
2525- admin_password = "ThisIsWhatIUseEverywhereTryIt";
2625 site_name = "Lemmy FTW";
2726 admin_email = "mightyiam@example.com";
2827 };
2928 # https://github.com/LemmyNet/lemmy/blob/50efb1d519c63a7007a07f11cc8a11487703c70d/crates/utils/src/settings/mod.rs#L52
3029 database.uri = "postgres:///lemmy?host=/run/postgresql&user=lemmy";
3130 };
3131+ secretFile = /etc/lemmy-config.hjson;
3232 caddy.enable = true;
3333 };
34343535+ environment.etc."lemmy-config.hjson".text = ''
3636+ {
3737+ "setup": {
3838+ "admin_password": "ThisIsWhatIUseEverywhereTryIt"
3939+ }
4040+ }
4141+ '';
4242+3543 networking.firewall.allowedTCPPorts = [ 80 ];
36443745 # pict-rs seems to need more than 1025114112 bytes
···4250 testScript = ''
4351 server = ${lemmyNodeName}
44524545- with subtest("the backend starts and responds"):
5353+ with subtest("the merged config is secure"):
4654 server.wait_for_unit("lemmy.service")
5555+ config_permissions = server.succeed("stat --format %A /run/lemmy/config.hjson").rstrip()
5656+ assert config_permissions == "-rw-------", f"merged config permissions {config_permissions} are insecure"
5757+ directory_permissions = server.succeed("stat --format %A /run/lemmy").rstrip()
5858+ assert directory_permissions[5] == directory_permissions[8] == "-", "merged config can be replaced"
5959+6060+ with subtest("the backend starts and responds"):
4761 server.wait_for_open_port(${toString backendPort})
4862 server.succeed("curl --fail localhost:${toString backendPort}/api/v3/site")
4963
···33, graalvmCEPackages
44, removeReferencesTo
55, fetchurl
66-, writeScript }:
66+, writeScript
77+}:
7889buildGraalvmNativeImage rec {
99- pname = "babashka";
1010+ pname = "babashka-unwrapped";
1011 version = "1.3.181";
11121213 src = fetchurl {
1313- url = "https://github.com/babashka/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
1414+ url = "https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-standalone.jar";
1415 sha256 = "sha256-NzchlHRxOCSyUf9U0Jv8h4bgKd2Jwp+LmxIfeV8+8+M=";
1516 };
1617···2627 "--native-image-info"
2728 "--enable-preview"
2829 ];
3030+3131+ doInstallCheck = true;
29323033 installCheckPhase = ''
3134 $out/bin/bb --version | grep '${version}'
···6871 too simple to be worth writing a clj/s script for. Babashka really
6972 seems to hit the sweet spot for those cases.
70737171- Goals:
7474+ Goals:
72757373- - Low latency Clojure scripting alternative to JVM Clojure.
7474- - Easy installation: grab the self-contained binary and run. No JVM needed.
7575- - Familiarity and portability:
7676- - Scripts should be compatible with JVM Clojure as much as possible
7777- - Scripts should be platform-independent as much as possible. Babashka
7878- offers support for linux, macOS and Windows.
7979- - Allow interop with commonly used classes like java.io.File and System
8080- - Multi-threading support (pmap, future, core.async)
8181- - Batteries included (tools.cli, cheshire, ...)
8282- - Library support via popular tools like the clojure CLI
7676+ - Low latency Clojure scripting alternative to JVM Clojure.
7777+ - Easy installation: grab the self-contained binary and run. No JVM needed.
7878+ - Familiarity and portability:
7979+ - Scripts should be compatible with JVM Clojure as much as possible
8080+ - Scripts should be platform-independent as much as possible. Babashka
8181+ offers support for linux, macOS and Windows.
8282+ - Allow interop with commonly used classes like java.io.File and System
8383+ - Multi-threading support (pmap, future, core.async)
8484+ - Batteries included (tools.cli, cheshire, ...)
8585+ - Library support via popular tools like the clojure CLI
8386 '';
8487 homepage = "https://github.com/babashka/babashka";
8588 changelog = "https://github.com/babashka/babashka/blob/v${version}/CHANGELOG.md";
+2
pkgs/development/interpreters/clojure/default.nix
···7171 update-source-version clojure "$latest_version"
7272 '';
73737474+ passthru.jdk = jdk;
7575+7476 meta = with lib; {
7577 description = "A Lisp dialect for the JVM";
7678 homepage = "https://clojure.org/";
···14961496 rr-unstable = rr; # Added 2022-09-17
14971497 rssglx = throw "'rssglx' has been renamed to/replaced by 'rss-glx'"; # Converted to throw 2022-02-22
14981498 rssh = throw "rssh has been removed from nixpkgs: no upstream releases since 2012, several known CVEs"; # Added 2020-08-25
14991499+ rtl8723bs-firmware = throw "rtl8723bs-firmware was added in mainline kernel version 4.12"; # Added 2023-07-03
14991500 rtv = throw "rtv was archived by upstream. Consider using tuir, an actively maintained fork"; # Added 2021-08-08
15001501 rtsp-simple-server = throw "rtsp-simple-server is rebranded as mediamtx, including default config path update"; # Added 2023-04-11
15011502 rubyMinimal = throw "rubyMinimal was removed due to being unused";
···430430431431 rtl8189fs = callPackage ../os-specific/linux/rtl8189fs { };
432432433433- rtl8723bs = callPackage ../os-specific/linux/rtl8723bs { };
434434-435433 rtl8723ds = callPackage ../os-specific/linux/rtl8723ds { };
436434437435 rtl8812au = callPackage ../os-specific/linux/rtl8812au { };
···563561 } // lib.optionalAttrs config.allowAliases {
564562 ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
565563 sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14
564564+ rtl8723bs = throw "rtl8723bs was added in mainline kernel version 4.12"; # Added 2023-06-14
566565 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18";
567566 });
568567
+1
pkgs/top-level/python-aliases.nix
···316316 sphinx_rtd_theme = sphinx-rtd-theme; # added 2022-08-03
317317 sphinxcontrib-autoapi = sphinx-autoapi; # added 2023-02=28
318318 sphinxcontrib_plantuml = sphinxcontrib-plantuml; # added 2021-08-02
319319+ sphinx-navtree = throw "sphinx-navtree has been removed since it is not compatible with sphinx 3.3 and unmaintained"; # added 2023-07-03
319320 sqlalchemy_migrate = sqlalchemy-migrate; # added 2021-10-28
320321 SQLAlchemy-ImageAttach = throw "sqlalchemy-imageattach has been removed as it is incompatible with sqlalchemy 1.4 and unmaintained"; # added 2022-04-23
321322 suds-jurko = throw "suds-jurko has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2023-02-27