Commit Graph

31661 Commits

Author SHA1 Message Date
pennae
1229e735ac nixos-render-docs: add structural includes, use for manual
this adds support for structural includes to nixos-render-docs.
structural includes provide a way to denote the (sub)structure of the
nixos manual in the markdown source files, very similar to how we used
literal docbook blocks before, and are processed by nixos-render-docs
without involvement of xml tooling. this will ultimately allow us to
emit the nixos manual in other formats as well, e.g. html, without going
through docbook at all.

alternatives to this source layout were also considered:

a parallel structure using e.g. toml files that describe the document
tree and links to each part is possible, but much more complicated to
implement than the solution chosen here and makes it harder to follow
which files have what substructure. it also makes it much harder to
include a substructure in the middle of a file.

much the same goes for command-line arguments to the converter, only
that command-lined arguments are even harder to specify correctly and
cannot be reasonably pulled together from many places without involving
another layer of tooling. cli arguments would also mean that the manual
structure would be fixed in default.nix, which is also not ideal.
2023-02-12 13:02:42 +01:00
pennae
8b7f0e559a nixos/manual: clean up default.nix a bit
- inline copySources into single user
- remove `inherit sources` where it's not necessary
- inline generatedSources. this will go away completely soon so we may
  as well.
- inline modulesDoc into manual-combined. this too will go away soon.
- inline sources into manual-combined. this too will go away soon.
2023-02-12 11:58:20 +01:00
pennae
ef413e3eac nixos/manual: split manpages-combined from manual-combined
once we generate the entire manual-combined.xml with a single
nixos-render-docs invocation we will no longer need any options xml
files. likewise we do not need the test options xml in the manpage
build. splitting manpages-combined from manual-combined also allows
these two to run in parallel, slightly improving build times.
2023-02-12 11:56:26 +01:00
pennae
9977f99740 nixos/manual: inline man-configuration.xml
man-configuration.xml is the only manpage we build using docbook at this
time, and man-pages.xml includes just this one file. inline
man-configuration.nix into man-pages.xml so we can refer to a single
file to grab the manpage sources later rather than using find-by-suffix.
2023-02-12 11:55:10 +01:00
pennae
d041641b1a nixos/manual: remove md-to-db
with manual chapters no longer needing pandoc for their conversion to
xml we can get rid of this source of confusion, and its huge cache of
xml files.
2023-02-10 06:40:15 +01:00
pennae
652a283e51 nixos-render-docs: render manual chapters during manual build
render all manual chapters to docbook from scratch every time the manual
is built. nixos-render-docs is quick enough at this to not worry about
the cost (needing only about a second), and it means we can remove
md-to-db.sh in the next commit.

no changes to the rendered html manual except for replacements and smartquotes.
2023-02-10 06:40:02 +01:00
pennae
67917ac102 nixos-render-docs: rename manual docbook converter to docbook-section
we'll soon add another docbook converter that does not emit a section as
a collection of chapters, but sections or chapters on their own. this
should clarify naming a bit before there can be any confusion.
2023-02-10 06:40:02 +01:00
pennae
1c9f55ec64 nixos/manual: convert <kbd> elements to bracketed spans
since support for kbd elements was added with explicit intent in #175128
it seems like a good idea to support this in nixos-render-docs instead
of just dropping it in favor of `*F12*` etc. since it's a very rare
thing in the manual and purely presentational it makes sense to use
bracketed spans instead of a new myst role.

the html-elements.lua plugin is now somewhat misnamed, but it'll go away
very soon so we don't want to bother renaming it.
2023-02-10 06:40:01 +01:00
pennae
65d749c80b nixos/manual: inline the single footnote
this is a lot easier than adding footnote support for just the one
instance. if a use case for footnotes appears in the future (e.g. if we
wanted to render the nixpkgs manual with nixos-render-docs as well) this
decision should be reevaluated.
2023-02-10 06:40:01 +01:00
pennae
2ad93ab199 nixos/manual: remove remaining docbook tags
there's one remaining instance of literal docbook tags in the manual.
replace it with a literal (as has been done for package tags everywhere else).
2023-02-10 06:40:01 +01:00
pennae
bb34d5d6d4 nixos/manual: replace ids on blocks with inline anchors
nixos-render-docs supports inline anchors, but not ids for blocks. it
seems wise to reserve blocks for special cases that don't have other
syntax already, like admonitions.
2023-02-10 06:40:01 +01:00
pennae
2e3d9e8d74 nixos/manual: remove .unnumbered section attributes
pandoc would drop these when converting to docbook, just like it dropped
.title block classes.
2023-02-10 06:40:01 +01:00
pennae
a15d7335a5 nixos/manual: remove .title fenced divs
pandoc drops .title classes when rendering to docbook, so these are
effectively just paragraphs anyway. without support for including them
in a table of contents the complexity of parsing them in
nixos-render-docs won't be warranted.
2023-02-10 06:40:00 +01:00
pennae
8163651338 nixos/manual: fix option-declarations sections
the examples for mkPackageOption weren't terminated, leading to pretty
odd nesting of docbook (and thus html) elements. close them properly.

also turn the (likewise unclosed) fenced div containing just an anchor
id and a class that will be silently dropped to an inline anchor while
we're here. we'd have to convert it anyway later.
2023-02-10 06:40:00 +01:00
pennae
ba4bcdc5e4 nixos/manual: remove some newlines from deflists
markdown-it parses deflists slitghtly differently than pandoc does. in
these two cases pandoc would find a deflist item while markdown-it would
not, instead it'd find a lone colon and the rest of the text.
2023-02-10 06:40:00 +01:00
pennae
861ebec769 nixos/manual: don't use multi-definitions in installer chapter
pandoc renders these to multiple docbook paragraphs in a single
definition for the term, not multiple *actual* definitions for the same
term. this is most likely not what is intended here, so let's use
multiple paragraphs instead.
2023-02-10 06:40:00 +01:00
pennae
7098315342 nixos/manual: delete disabled xincludes
userconfiguration.xml hasn't existed for a while, and this comment will
interfere with processing we'll be doing shortly.
2023-02-10 06:40:00 +01:00
pennae
f1e888a53c nixos/manual: moving contributing chapter toc entry
this should be placed before the appendices, not between them. might
even have a good place in the development part, but that's a decision
for another day.
2023-02-10 06:40:00 +01:00
pennae
10f2c3cacf nixos/manual: remove sources input from manpages drv
it's not used. holdover from when manpages were written in docbook.
2023-02-10 06:40:00 +01:00
Aaron Andersen
ce81c3ab72
Merge pull request #215554 from bb2020/dlna
nixos/minidlna: minor changes
2023-02-09 21:45:59 -05:00
Nick Cao
4ba33a758f
Merge pull request #215489 from Alper-Celik/master
nixos/plasma5: use vlc phonon backend by default
2023-02-10 09:27:37 +08:00
bb2020
76bf633dc2 nixos/minidlna: minor changes 2023-02-09 21:11:20 +03:00
Alvar Penning
63dd9fb5c8 nixos/ympd: Unit hardening
Next to some systemd unit hardening, the nobody user isn't used anymore,
as suggested in #55370.
2023-02-09 19:10:19 +01:00
Robert Hensing
1991c40759
Merge pull request #194345 from codedownio/binary-cache
Introduce mkBinaryCache function
2023-02-09 15:25:16 +01:00
Alper Çelik
0b74f9829f
nixos/plasma5: use vlc phonon backend by default 2023-02-09 13:53:28 +03:00
Nick Cao
6fa2bfdf4d
Merge pull request #215110 from gador/pgadmin-use-pstgresqltesthook
pgadmin4-desktopmode: init at 6.19, pgadmin4: simplify tests
2023-02-09 16:05:44 +08:00
Florian Brandes
a380674d85
pgadmin4: add option to enable desktop mode
By default, pgadmin4 uses SERVER_MODE = True. This requires
access to system directories (e.g. /var/lib/pgadmin). There is
no easy way to change this mode during runtime. One has to change
or add config files withing pgadmin's directory structure to change it
or add a system-wide config file under `/etc/pgadmin`[1].

This isn't always easy to achive or may not be possible at all. For
those usecases this implements a switch in the pgadmin4 derivation and
adds a new top-level package `pgadmin4-desktopmode`. This builds in
DESKTOP MODE and allows the usage of pgadmin4 without the nixOS module
and without access to system-wide directories.

pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
pgadmin4-desktopmode tries to read that as well. This normally fails with
a PermissionError, as the config file is owned by the user of the pgadmin module.

With the check-system-config-dir.patch this will just throw a warning
but will continue and not read the file.

If we run pgadmin4-desktopmode as root
(something one really shouldn't do), it can read the config file and fail,
because of the wrong config for desktopmode.

[1]https://www.pgadmin.org/docs/pgadmin4/latest/config_py.html

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2023-02-09 08:19:05 +01:00
Florian Brandes
2b63943be4 nixosTests.pgadmin4-standalone: format
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2023-02-09 08:06:54 +01:00
Florian Brandes
e4488f5efe pgadmin4: move package tests back into the package
We test pgadmin in nixosTests, because it needs a running postgresql instance.
This is now unnecessary since we can do so in the package itself.

This reduces the complexity of pgadmin and removes the need for the extra
nixosTests.

Also setting SERVER_MODE in `pkg/pip/setup_pip.py` does not have any effect
on the final package, so we remove it.
In NixOS, we use the module, which expects SERVER_MODE to be true (which it defaults to).
In non-NixOS installations, we will need the directory /var/lib/pgadmin and /var/log/pgadmin

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2023-02-09 08:06:52 +01:00
Nick Cao
aef8797863
Merge pull request #215345 from Izorkin/fix-coredump-id
nixos/systemd-coredump: fix group id
2023-02-09 13:52:05 +08:00
Nick Cao
e95397343c
Merge pull request #215369 from IndeedNotJames/caddy
caddy: 2.6.2 -> 2.6.3
2023-02-09 12:06:41 +08:00
IndeedNotJames
f5a06f7150
nixos/caddy: fix caddy fmt for caddy v2.6.3
The nixos module uses `caddy fmt` to *format* the generated Caddyfile.
v2.6.3 slightly altered `caddy fmt`'s behavior.

Excerpt from https://github.com/caddyserver/caddy/releases/tag/v2.6.3
> cmd: caddy fmt return code is 1 if not formatted
> cmd: fmt exit successfully after overwriting config file

Which is why the internal `Caddyfile-formatted` now uses `cp` and `caddy fmt --overwrite` instead
2023-02-09 03:36:10 +01:00
Justin Bedő
f2ab8c706d
Merge pull request #158486 from ShamrockLee/singularity-apptainer
singularity: fix defaultPath and reflect upstream changes
2023-02-08 23:47:32 +00:00
Izorkin
6b9583e5e1
nixos/systemd-coredump: fix group id 2023-02-08 20:48:13 +03:00
Jörg Thalheim
10d5d6196a
Merge pull request #213601 from SuperSandro2000/envfs-wsl
nixos/envfs: use configured environment.usrbinenv and environment.binsh, add extraFallbackPath options
2023-02-08 16:43:39 +01:00
Sandro Jäckel
1c664befd4
nixos/envfs: add extraFallbackPathCommands options
this is mainly useful for restricted platforms like wsl which require
some extra entries in /bin/
2023-02-08 15:52:38 +01:00
pennae
10a4f0daca nixos-render-docs: add options manpage converter
mdoc is just too slow to render on groff, and semantic markup doesn't
help us any for generated pages.

this produces a lot of changes to configuration.nix.5, but only few
rendering changes. most of those seem to be place losing a space where
docbook emitted roff code that did not faithfully represent the input
text, though a few places also gained space where docbook dropped them.
notably we also don't need the compatibility code docbook-xsl emitted
because that problem was fixed over a decade ago.

this will handle block quotes, which the docbook stylesheets turned into
a mess of roff requests that ended up showing up in the output instead
of being processed.
2023-02-08 15:23:34 +01:00
pennae
8fe19590c3 nixos/make-options-doc: fix related packages link label
the pkgs path literal surely shouldn't include the title, right?
2023-02-08 15:23:34 +01:00
pennae
bf4c0c1900 nixos/*: remove trailing period in mkEnableOptions
those are added by mkEnableOption, and .. is replaced to … by markdown
processing.
2023-02-08 15:23:34 +01:00
pennae
2f9d71afdb nixos/x11: fix some docs links
the docbook stylesheets duplicated the target of these untitled links
into their label, but we should do that in markdown instead.
2023-02-08 15:23:34 +01:00
K900
666ae72408
Merge pull request #215276 from K900/kio-admin
kio-admin: init at 1.0.0
2023-02-08 16:34:53 +03:00
Sandro
a7b862f4f9
Merge pull request #215243 from winterqt/luksroot-pbkdf2-sha512-fix
nixos/luksroot: build pbkdf2-sha512 binary in its own derivation
2023-02-08 11:04:11 +01:00
Yueh-Shun Li
71a89291ee apptainer, singularity: enable non-FHS --fakeroot support
This patch provides input arguments `newuidmapPath` and `newgidmapPath`
for apptainer and singularity to specify the path to the SUID-ed executables
newuidmap and newgidmap where they are not available from the FHS PATH.

As NixOS places those suided executables in a non-FHS position
(/run/wrapper/bin), this patch provides
programs.singularity.enableFakeroot option and implement with the above
input parameters.
2023-02-08 18:04:05 +08:00
Yueh-Shun Li
50788d2fb0 apptainer, singularity: fix defaultPath and reflect upstream changes
Upstream changes:
singularity 3.8.7 (the legacy) -> apptainer 1.1.3 (the renamed) / singularity 3.10.4 (Sylabs's fork)

Build process:
*   Share between different sources
*   Fix the sed regexp to make defaultPath patch work
*   allowGoReference is now true
*   Provied input parameter removeCompat (default to false)
    that removes the compatible "*singularity*" symbolic links
    and related autocompletion files when projectName != "singularity"
*   Change localstatedir to /var/lib
*   Format with nixpkgs-fmt
*   Fix the defaultPath patching
    and use it instead of the `<executable> path` config directive
    deprecated in Apptainer
*   Provide dependencies for new functionalities such as
    squashfuse (unprivileged squashfs mount)
*   Provide an attribute `defaultPathInputs` to override
    prefix of container runtime default PATH

NixOS module programs.singularity:
*   Allow users to specify packages
*   Place related directories to /var/lib
*   Format with nixpkgs-fmt

singularity-tools:
*   Allow users to specify packages
*   Place related directories to /var/lib when building images in VM
2023-02-08 18:03:11 +08:00
Yueh-Shun Li
136bbe2605 nixos/modules/programs/singularity.nix: format expression 2023-02-08 17:42:03 +08:00
K900
4a514c6754 nixos/plasma5: install kio-admin for desktop 2023-02-08 12:38:14 +03:00
Winter
b2d04c1155 nixos/luksroot: build pbkdf2-sha512 binary in its own derivation
Since this feature's inception, we've compiled a binary that uses OpenSSL
to perform PBKDF-SHA512 during the extra-utils build. In addition to this
being inefficient, it broke as of 6ea1a2a1be,
which switched the extra-utils derivation to use stdenvNoCC.

For now, I think the path of least resistence is to move the pbkdf-sha512
build to its own derivation, to fix the breakage, as well as improving
the efficiency of the extra-utils build.

(I do believe that at some point, we should revisit this binary -- perhaps
rewriting it -- as Clang even just on its default settings emits more
warnings than you'd want to see in a security-related codebase when
compiling it.)
2023-02-07 23:06:11 -05:00
Nick Cao
41460f747c
Merge pull request #214363 from jerith666/k3b-cdrtools
k3b: use cdrecord from cdrtools rather than cdrkit
2023-02-08 10:48:09 +08:00
Tom McLaughlin
d1a2a16a3a Introduce mkBinaryCache function 2023-02-07 16:16:07 -08:00
Will Fancher
eec740325c initrd-ssh: New sshd settings names 2023-02-07 13:56:02 -05:00