Commit graph

940 commits

Author SHA1 Message Date
pennae c8b4e5d557
Merge pull request #237557 from pennae/dedocbookify-nixos
nixos/doc: dedocbookify
2023-06-19 14:05:03 +02:00
Ryan Lahfa 3d941b6be8
Merge pull request #236656 from nikstur/qemu-vm-persistent-block-device-names 2023-06-17 14:52:26 +02:00
Raito Bezarius 7088e386ff nixosTests.kexec: reconnect properly after 2nd kexec
By some miracle, before, it was possible to reconnect to the `node1` without
doing any relevant dance.

But now we are direct booting (¿), it seems like we need to do the right things.

This introduces a `check_output` flag for `execute` because we do not want to steal the
messages from the backdoor service as we might execute the kexec too fast compared
to when we will reconnect.

Therefore, we will let the message in the pipe if needed.
2023-06-16 19:43:40 +02:00
nikstur 0bdba6c99b nixos/qemu-vm: use persistent block device names
This change removes the bespoke logic around identifying block devices.
Instead of trying to find the right device by iterating over
`qemu.drives` and guessing the right partition number (e.g.
/dev/vda{1,2}), devices are now identified by persistent names provided
by udev in /dev/disk/by-*.

Before this change, the root device was formatted on demand in the
initrd. However, this makes it impossible to use filesystem identifiers
to identify devices. Now, the formatting step is performed before the VM
is started. Because some tests, however, rely on this behaviour, a
utility function to replace this behaviour in added in
/nixos/tests/common/auto-format-root-device.nix.

Devices that contain neither a partition table nor a filesystem are
identified by their hardware serial number which is injecetd via QEMU
(and is thus persistent and predictable). PCI paths are not a reliably
way to identify devices because their availability and numbering depends
on the QEMU machine type.

This change makes the module more robust against changes in QEMU and the
kernel (non-persistent device naming) and by decoupling abstractions
(i.e. rootDevice, bootPartition, and bootLoaderDevice) enables further
improvement down the line.
2023-06-16 19:36:03 +02:00
Jörg Thalheim 4f992e8da0
Merge pull request #237840 from lilyinstarlight/fix/systemd-initrd-vconsole-test
nixos/tests/systemd-initrd-vconsole: fix test and improve reliability
2023-06-15 19:41:08 +01:00
Lily Foster f1f0d4fbdd
nixos/test-driver: fix timeout option for wait_for_console_text 2023-06-15 06:47:49 -04:00
pennae f52f531a4e nixos/make-options-doc: deprecate docbook outputs
they're no longer necessary for us and will almost definitely start to
rot now (like commonmark and asciidoc outputs did previously). most
existing users seem to take the docbook output and run it through pandoc
to generate html, those can easily migrate to use commonmark instead.
other users will hopefully pipe up when they notice that things they rely
on are going away.

optionsUsedDocbook has only been around for one release and only exposed
to allow other places to generate warnings, so that does not deserve
such precautions.
2023-06-13 16:56:32 +02:00
pennae 20152b4269 nixos/doc: remove docbook options compatibility
no longer needed or useful, and may even produce false positives now
that markdown is the default language for option docs.
2023-06-13 16:56:31 +02:00
pennae 1418c986b0 nixos/make-options-doc: remove options postprocessing
with everything being rendered from markdown now we no longer need to
postprocess any options.xml that may be requested from elsewhere. we'll
don't need to keep the module path check either since that's done by
optionsJSON now.
2023-06-13 16:56:31 +02:00
pennae af1f07ff03 nixos/make-options-doc: check for manual paths in options.json
since we no longer use the docbook path the check there will no longer
fire. add one to optionsJSON to not lose this functionality.
2023-06-13 16:56:31 +02:00
pennae 34eeac5544 nixos-render-docs: default to markdown for options
docbook is now gone and we can flip the defaults. we won't keep the
command line args around (unlike the make-options-docs argument) because
nixos-render-docs should not be considered an exposed API.
2023-06-13 16:56:31 +02:00
pennae c01244394c nixos/make-options-doc: force markdownByDefault
with docbook no longer supported we can default to markdown option docs.
we'll keep the parameter around for a bit to not break external users
who set it to true. we don't know of any users that do, so the
deprecation period may be rather short for this one.
2023-06-13 16:56:30 +02:00
pennae 0997ae1903 nixos/manual: disallow docbook option docs
it's been long in the making, and with 23.05 out we can finally disable
docbook option docs and default to markdown instead. this brings a
massive speed boost in manual and manpage builds, so much so that we may
consider enabling user module documentation by default.

we don't remove the docbook support code entirely yet because it's a lot
all over, and probably better removed in multiple separate changes.
2023-06-13 16:56:30 +02:00
Thomas Baggaley 491efa0b3e test-driver: respect timeout in wait_until_fails
- `wait_until_fails` was not passing through its `timeout` argument to
  the internal `retry` function, hence was always using 900 seconds (the
  default timeout for `retry`) rather than the user-specified value.
2023-06-13 05:11:33 +01:00
Alyssa Ross 507ff39251 nixos/test-driver: fix formatting
This caused the test driver to fail to build.

Fixes: 406de94b41 ("nixos/test-driver: add `timeout` option for `wait_for_console_text`")
2023-05-28 12:29:26 +00:00
Jacek Galowicz b4b45ee6d2
Revert "nixos/lib/test-driver: enable EFI variable reads at runtime" 2023-05-28 13:05:59 +02:00
Jacek Galowicz d9626034f1
Merge pull request #234513 from NixOS/test-driver/wait_for_console_timeout
nixos/test-driver: add `timeout` option for `wait_for_console_text`
2023-05-28 09:57:00 +02:00
Jacek Galowicz be62469b22
Merge pull request #229027 from NixOS/qemu-vm/read-efi-var
nixos/lib/test-driver: enable EFI variable reads at runtime
2023-05-28 09:51:29 +02:00
Raito Bezarius d1104e2109 nixos/test-driver: add timeout option for wait_for_console_text (variant 2) 2023-05-28 00:07:43 +02:00
Raito Bezarius 406de94b41 nixos/test-driver: add timeout option for wait_for_console_text
Previously, `wait_for_console_text` would block indefinitely until there were lines
shown in the buffer.

This is highly annoying when testing for things that can just hang for some reasons.

This introduces a classical timeout mechanism via non-blocking get on the Queue.
2023-05-27 23:55:52 +02:00
Raito Bezarius f1aee66f92 nixos/lib/test-driver: enable EFI variable reads at runtime
This is useful whenever you want to diagnose the current state of UEFI
variables, to assert that bootloaders or boot programs (systemd-stub)
did their job correctly and set their variables accordingly.

In the future, it can enable inspecting SecureBoot keys also.
2023-05-27 22:44:58 +02:00
Jacek Galowicz 3580ac6c65
Merge pull request #234427 from alyssais/create_machine
nixos/test-driver: undeprecate create_machine
2023-05-27 17:02:11 +02:00
Alyssa Ross e33c2a5e4c nixos/test-driver: add missing spaces to warning 2023-05-27 15:00:00 +00:00
Alyssa Ross 845576aac4
nixos/test-driver: undeprecate create_machine
This warning was added a year and a half ago, but still no test in
NixOS directly instantiates the machine class, presumably because it's
not actually possible for a test to do so without losing
functionality.  For example, there's no way for a NixOS test to access
the output directory that create_machine passes to the Machine
constructor.

This warning is therefore just contributing to alert fatigue for
users, who are unable to follow its advice.  Once it's actually
possible to do what it suggests, the warning can be reintroduced.
2023-05-27 12:56:04 +00:00
Graham Dennis 8e58daad02 nixos/qemu-vm: quoted string reformat 2023-05-24 08:54:22 +10:00
Graham Dennis 93502aa3b1 nixos/qemu-vm: add option for named network interfaces
Adds a new option to the virtualisation modules that enables specifying explicitly named network interfaces in QEMU VMs.
The existing `virtualisation.vlans` option is still supported for cases where the name of the network interface is irrelevant.
2023-05-24 08:54:20 +10:00
figsoda 202699c918 nixos/tests: fix typos 2023-05-19 22:31:04 -04:00
Will Fancher a13191189f
Merge pull request #230316 from wrvsrx/fix-x-restart-triggers
nixos/lib: hash triggers after converting them to string in systemd-lib
2023-05-19 09:25:56 -04:00
Naïm Favier 3ac4b371b3
Merge pull request #214373 from ncfavier/make-image-structured-attrs
make-squashfs,make-iso9660-image: use `__structuredAttrs`
2023-05-18 19:33:59 +02:00
Et7f3 edf5659688
systemd.units.<name>.wantedBy: fix documentation rendering
It need to be marked as inline code block
2023-05-18 18:04:31 +02:00
Ryan Lahfa 5a7e90bc95
Merge pull request #228801 from NixOS/make-disk-image-faster
nixos/lib/make-disk-image: do not compile a full arch QEMU to convert images
2023-05-15 13:24:08 +02:00
Robert Hensing 5c3e59b6d6
Merge pull request #230523 from hercules-ci/fast-nixos-test-eval
Fast nixos test eval
2023-05-11 17:34:46 +02:00
Robert Hensing b0e17891f2 nixos/testing/nodes.nix: Do not rely on disabledModules
It's just not necessary.
2023-05-11 16:24:01 +02:00
Robert Hensing 0f83261f0e nixos/testing: Add node.pkgsReadOnly escape hatch
By adding this option indirection, a test can declare all by itself
that it needs a custom nixpkgs. This is a more convenient way of
going about this when the caller of the test framework receives a
`node.pkgs` unconditionally.
2023-05-11 16:24:01 +02:00
Robert Hensing f659db7ba2 nixos/testing: Add node.pkgs option
By factoring out this logic, it's easier for other projects to make
use of it this optimization too (and do it correctly).
2023-05-11 16:24:00 +02:00
Robert Hensing b213791e7e nixos/all-tests.nix: Add readOnlyPkgs module 2023-05-11 16:24:00 +02:00
Naïm Favier ea81a2465e
make-iso9660-image: use __structuredAttrs
Makes it easier to enable discarding of references, a feature of Nix
2.14 which requires structured attrs.
2023-05-11 14:25:44 +02:00
Naïm Favier 56226c4674
make-squashfs: use __structuredAttrs
Makes it easier to enable discarding of references, a feature of Nix
2.14 which requires structured attrs.
2023-05-11 14:25:31 +02:00
wrvsrx 05129aab01
nixos/lib: save triggers of systemd into nix store 2023-05-11 17:38:54 +08:00
Robert Hensing cd358fe24e nixos/all-tests.nix: Set nixpkgs.system 2023-05-10 15:55:09 +02:00
Robert Hensing 693e2c3287 nixos/eval-config: Remove statically known mkIf
mkIf is unnecessary when the condition is statically known - that is
knowable before entering the module evaluation.

By changing this to a precomputed module, we support changing the
defined options to readOnly options.
2023-05-10 15:55:09 +02:00
Jacek Galowicz b7dfa5082a
Merge pull request #228220 from R-VdP/test_driver_guest_shell_timeout
nixos-test-driver: include a timeout for the recv call, do not assume sh == bash
2023-05-09 13:05:28 +02:00
wrvsrx cc41b47c6f
nixos/lib: hash triggers after converting them to string in systemd-lib
This change is made for two reasons:

1.  If `toString config.restartTriggers` containes `\n`, systemd unit
    file will be ill-formed.
2.  This change can limit length of the trigger, although it doesn't
    matter in most cases.
2023-05-07 09:04:18 +08:00
Robert Hensing 8054785157 lib/modules: Move class out of specialArgs 2023-05-06 18:32:58 +02:00
Robert Hensing 79703eef08 nixos,nixpkgs: Add module classes
This allows modules that declare their class to be checked.
While that's not most user modules, frameworks can take advantage
of this by setting declaring the module class for their users.
That way, the mistake of importing a module into the wrong hierarchy
can be reported more clearly in some cases.
2023-05-06 18:29:04 +02:00
Raito Bezarius a22826f46a nixos/lib/make-(multi|single)-disk-zfs-image: use qemu_kvm (host arch) instead of qemu (all arches) 2023-04-28 23:50:44 +02:00
Raito Bezarius 77c0b522b7 nixos/lib/make-disk-image: do not compile a full arch QEMU to convert images 2023-04-28 23:40:57 +02:00
r-vdp 4147b878bc
nixos-test-driver: include a timeout for the recv call, do not assume sh == bash 2023-04-26 01:05:53 +02:00
Alyssa Ross d6e84a4574
nixosTest: remove hostname limitations 2023-04-25 08:55:30 +00:00
Leon Barrett 15c760d6b8 nixos/make-disk-image: fix contents dir paths
`make-disk-image` is a tool for creating VM images. It takes an argument
`contents` that allows one to specify files and directories that should
be copied into the VM image. However, directories end up not at the
specified target, but instead at a subdirectory of the target, with a
nix-store-like path, e.g.
`/target/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-source`. See issue
https://github.com/NixOS/nixpkgs/issues/226203 .

This change adds a test for make-disk-image's contents directory
handling and adds a fix (appending `/` to rsync input directory names).

This closes issue https://github.com/NixOS/nixpkgs/issues/226203 .
2023-04-16 09:54:45 -07:00
Sandro df9856c9b3
Merge pull request #222110 from SuperSandro2000/root-slice
systemd-lib: fix building -.slice (root slice)
2023-03-23 14:10:24 +01:00
Alyssa Ross 27f97953e0
nixos/test-driver: accept non-\w* filenames
What the code was trying to do was helpfully add a directory and
extension if none were specified, but it did this by checking whether
the filename was composed of a very limited character set that didn't
even include dashes.

With this change, the intention of the code is clearer, and I can put
dashes in my screenshot names.
2023-03-22 15:54:06 +00:00
Sandro Jäckel a10f3197fc
systemd-lib: fix building -.slice (root slice)
The error was:

dirname: invalid option -- '.'
Try 'dirname --help' for more information.
2023-03-20 01:11:23 +01:00
Astro 64a4ae6f37 nixos/test-driver: remove allow_reboot state from Machine, make it a start() kwarg 2023-03-16 01:50:15 +01:00
Astro 9fc85a85d5 nixos/test-driver: implement Machine.reboot() 2023-03-16 01:41:32 +01:00
Astro 95d121e798 nixos/test-driver: fix allow_reboot 2023-03-15 12:48:01 +01:00
Nick Bathum 519958c94b
nixos/lib/make-multi-disk-zfs-image: expose memSize parameter
closes #178095
2023-02-26 20:18:04 -05:00
Nick Bathum 59462da917
nixos/lib/make-disk-image: expose memSize parameter
Generating large disk images can fail from out-of-memory in vm-run.
2023-02-26 12:08:58 -05:00
pennae 417dd2ad16 nixos-render-docs: add options asciidoc converter
same reasoning as for the earlier commonmark converter.
2023-02-21 18:19:00 +01:00
pennae 4d3aef762f nixos-render-docs: add options commonmark converter
the old method of pasting parts of options.json into a markdown document
and hoping for the best no longer works now that options.json contains
more than just docbook. given the infrastructure we have now we can
actually render options.md properly, so we may as well do that.
2023-02-21 18:19:00 +01:00
pennae 81cf173256 nixos-render-docs: use multiprocessing for options
options processing is pretty slow right now, mostly because the
markdown-it-py parser is pure python (and with performance
pessimizations at that). options parsing *is* embarassingly parallel
though, so we can just fork out all the work to worker processes and
collect the results.

multiprocessing probably has a greater benefit on linux than on darwin
since the worker spawning method darwin uses is less efficient than
fork() on linux. this hasn't been tested on darwin, only on linux, but
if anything darwin will be faster with its preferred method.
2023-02-18 13:17:57 +01:00
K900 254426ec4b nixos/lib/testing: set default timeout for VM tests 2023-02-16 19:17:53 +03: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
Jacek Galowicz 7f88d9c34c
Merge pull request #214910 from rnhmjoj/pr-gnupg-test
nixos/tests/gnupg: init
2023-02-07 09:17:06 +01:00
rnhmjoj 067d688b16
nixos/test-driver: handle decoding errors in Machine.execute
The output of a command is not guaranteed to be valid UTF-8, so the
decoding can fail raising UnicodeDecodeError. If this happens during a
`succeeds` the check will be erroneously marked failed.

This changes the error handling to the "replace" mode, where invalid
codepoints are replaced with � (REPLACEMENT CHARACTER U+FFFD) and the
decoding can go on.
2023-02-07 08:47:14 +01:00
rnhmjoj f2929eb949
nixos/test-driver: drop logging from Machine.send_monitor_command
Several machine operations, like `send_chars` and `send_key`, are
implemented by calling `send_monitor_command`, possibly multiple times.
This generates a huge amount of unnecessary noise in the log, because
`send_monitor_command` is a low-level operation and an implementation
detail.

Here's an excerpt from a highlighted log before and afte the change.

Before:

    subtest: Can generate a PGP key
    machine: sending keys 'gpg --gen-key\n'
    machine: sending monitor command: sendkey g
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey g, in 0.00 seconds)
    machine: sending monitor command: sendkey p
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey p, in 0.00 seconds)
    machine: sending monitor command: sendkey g
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey g, in 0.00 seconds)
    machine: sending monitor command: sendkey spc
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey spc, in 0.00 seconds)
    machine: sending monitor command: sendkey 0x0C
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey 0x0C, in 0.00 seconds)
    machine: sending monitor command: sendkey 0x0C
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey 0x0C, in 0.00 seconds)
    machine: sending monitor command: sendkey g
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey g, in 0.00 seconds)
    machine: sending monitor command: sendkey e
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey e, in 0.00 seconds)
    machine: sending monitor command: sendkey n
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey n, in 0.00 seconds)
    machine: sending monitor command: sendkey 0x0C
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey 0x0C, in 0.00 seconds)
    machine: sending monitor command: sendkey k
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey k, in 0.00 seconds)
    machine: sending monitor command: sendkey e
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey e, in 0.00 seconds)
    machine: sending monitor command: sendkey y
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey y, in 0.00 seconds)
    machine: sending monitor command: sendkey ret
    machine: waiting for monitor prompt
    (finished: waiting for monitor prompt, in 0.00 seconds)
    (finished: sending monitor command: sendkey ret, in 0.00 seconds)
    (finished: sending keys 'gpg --gen-key\n', in 0.15 seconds)

After:

    subtest: Can generate a PGP key
    machine: sending keys 'gpg --gen-key\n'
    (finished: sending keys 'gpg --gen-key\n', in 0.15 seconds)
2023-02-07 08:40:54 +01:00
Alyssa Ross 32d066dce3
channel: add --show-trace to nix-env command
Otherwise, when this fails on Hydra, we have no way of seeing what
went wrong.
2023-02-03 23:02:47 +00:00
pennae 5b6dcece88
Merge pull request #212684 from pennae/nixos-render-docs
nixos-render-docs: init, use for some manual rendering to docbook
2023-01-30 19:26:07 +01:00
Vladimír Čunát 23ce77d76e Revert #178290: nixos/virtualisation: add option
...for explicitly named network interfaces

This reverts commit 6ae3e7695e.
(and evaluation fixups 08d26bbb72 7aed90a969)
Some of the tests fail or time out after the merge.
2023-01-30 07:55:50 -08:00
pennae e8c5618b67 nixos-render-docs: add some better CLI infrastructure
using environment variables isn't great once multiple input or output
formats get involved (which will happen soon). now is a good time to set
a pattern for future converters.
2023-01-27 20:07:34 +01:00
pennae be6a25368f nixos-render-docs: init from optionsToDocbook.py
this new package shall eventually contain the rendering code necessary
to produce the entirety of the nixos (not nixpkgs) manual, in all of its
various output formats.
2023-01-27 20:07:33 +01:00
Jörg Thalheim e80e3878b3
Merge pull request #178533 from Mic92/nixos-tests-shell
nixos/tests: extend shell_interact to accept alternative socat addresses
2023-01-27 12:24:08 +00:00
Jörg Thalheim 29db54c373 nixos/tests: extend shell_interact to accept alternative socat addresses
`shell_interact()` is currently not nice to use.  If you try to cancel
the socat process, it will also break the nixos test. Furthermore
ptpython creates it's own terminal that subprocesses are running in,
which breaks some of the terminal features of socat.
Hence this commit extends `shell_interact` to allow also to connect to
arbitrary servers i.e. tcp servers started by socat.
2023-01-27 13:09:25 +01:00
pennae 9ff987764c nixos/make-options-doc: enable smartquotes and replacements
the rest of the nixos manual has them enabled, so we should enable them
here too for consistency.

this changes rendered output pervasively. changes also include quotes in
types (eg in `strings concatenated with "\n"`), but since those are not
code this is probably fine. if not we can probably add a myst role to
inhibit replacements.
2023-01-26 00:38:06 +01:00
pennae de22a26b4c nixos/make-options-doc: render option types through md
no changes to rendered output, but options.xml loses a few spaces.
2023-01-26 00:38:06 +01:00
pennae 6b677d9148 nixos/make-options-doc: disable inline html
we target not only html, but also manpages. inline html is not helpful
for the latter.
2023-01-26 00:38:06 +01:00
pennae ba1f533134 nixos/make-option-docs: wrap md parser+renderer into Converter
the new rendering tool will consist of a number of different Converters,
each with a possibly specialized Renderer.
2023-01-26 00:38:06 +01:00
pennae 3e45994a3b nixos/make-options-doc: don't use inspect for optionsToDocbook
the rules are fixed, and we want to support all of them (or throw a
useful error message). this will also become the base for a generic
renderer system, so let's just list all the rules statically.
2023-01-26 00:38:06 +01:00
Robert Hensing d255493e8f nixos/optionsToDocbook.py: Add docbook ns for when the appendix tag is omitted 2023-01-26 00:32:56 +01:00
pennae 0175a91aa3 nixos/make-options-doc: split docbook conversion from mergeJSON
this restores mergeJSON to its former glory if…merging json, and
extracts the MD rendering into a new script that will run instead of the
py+nix+xslt pipeline we previously ran to convert options.json to docbook.

this change alone gives a noticable performance boost when building
docs (18s instead of 27s to build optionsDocBook).

no changes to rendered output, except for a single example in the
rsnapshot module that uses hard tabs for indentation instead of spaces.
this probably isn't important.

docbook warnings remain with mergeJSON since the other processing steps
output single files instead of directories. since we'll only keep the
check until 23.11 this is probably also not important to fix.

also contains a few improvements to error reporting in the MD renderers.
2023-01-26 00:32:56 +01:00
pennae 381dcd7f9d nixos/make-options-doc: remove program argument to xslt
this doesn't seem to be set anywhere, not from make-options-doc nor
anywhere else.
2023-01-26 00:32:56 +01:00
Andrew Hoff 6ae3e7695e nixos/virtualisation: add option for explicitly named network interfaces
Adds a new option to the virtualisation modules that enables specifying
explicitly named network interfaces in QEMU VMs. The existing
`virtualisation.vlans` is still supported for cases where the name of
the network interface is irrelevant.
2023-01-22 12:20:40 -05:00
pennae e2019c49d4 nixos/make-options-doc: use markdown-it-py for rendering
only whitespace changes (mostly empty descriptions rendered as literal
line breaks and trailing space toPretty generates, but that were dropped
by mistune).
2023-01-22 17:50:09 +01:00
pennae 248e1b957d nixos/make-options-doc: render related packages with md
don't generate docbook for related packages, generate markdown instead.
this could be extended further to not even generate markdown but have
mergeJSON handle all of the rendering. markdown will work fine for now
though.
2023-01-22 17:50:09 +01:00
pennae fa8a594c56 nixos/make-options-doc: deprecate \n\n parbreak
only whitespace changes to rendered outputs, all in the vicinity or body
of admonitions. previously admonitions would not receive paragraph
breaks even when they should have because the description postprocessing
did not match on their contents.
2023-01-22 17:50:09 +01:00
pennae c93e5dde67 nixos/make-options-doc: rearrange paras in related packages/defaults/examples
this mirrors what we will be able to create with markdown. no change to
rendered outputs.
2023-01-22 17:50:09 +01:00
pennae 3a5f1ae029 nixos/make-options-doc: render default/example contents through MD
removes some trailing whitespaces from the html output, no other changes.
2023-01-22 17:50:09 +01:00
pennae 2bd8129a47 nixos/make-options-doc: make whitespace more md-compatible
markdown-it-py creates different whitespace leaders/trailers than are
currently emitted, and when we convert examples and defaults to render
via markdown the spacing will change too. this has no effect on rendered
output.
2023-01-22 17:50:09 +01:00
pennae d1aa187c0e nixos/make-options-doc: don't escape link urls twice
mistune already does escaping. it does escaping for html, but the
difference is small enough that can just ignore that we're actually
targeting docbook here.
2023-01-22 17:50:09 +01:00
pennae 2cb43da587 nixos/make-options-doc: remove trailing whitespace from strings
this was done only to make the conversion to MD easier to verify. we no
longer need it, and not keeping whitespace does not affect rendered outputs.

stripping will have to stay for now because description postprocessing
would add empty paragraphs otherwise.
2023-01-22 17:50:09 +01:00
pennae df09c21fb2 nixos/documentation: deprecate docbook option docs
following the plan in https://github.com/NixOS/nixpkgs/pull/189318#discussion_r961764451

also adds an activation script to print the warning during activation
instead of during build, otherwise folks using the new CLI that hides
build logs by default might never see the warning.
2023-01-22 17:08:40 +01:00
Guillaume Girol 33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00
Naïm Favier bff4bb5540
Merge pull request #208762 from ncfavier/link-manpages-options-doc 2023-01-09 11:57:01 +01:00
Naïm Favier fb1bc8de93
lib/modules: make mkAliasOptionModule emit DocBook
Follow-up to https://github.com/NixOS/nixpkgs/pull/208407

Removing `mdDoc` isn't enough, we need to emit actual DocBook.
2023-01-08 22:44:18 +01:00
Domen Kožar dce3b02d44
Merge pull request #209501 from sandydoo/improve/fix-commonmark-doc-isues
nixos/make-options-doc: skip re-escaping literal expressions
2023-01-08 11:14:57 +00:00
sandydoo 18df33f5bc
nixos/make-options-doc: skip re-escaping strings 2023-01-08 08:52:17 +00:00
pennae 9da5f12ecf modules: add mkPackageOptionMD
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05 02:33:13 +01:00
pennae 4c1cfbdb84 modules: add mkAliasOptionModuleMD
mkAliasOptionModule should not default to mdDoc descriptions because
that can break out-of-tree users of documentation infrastructure. add an
explicitly-MD variant for now, to be removed some time after the MD
transition is complete.
2023-01-05 02:33:13 +01:00
Naïm Favier 4fb500d629
nixos/doc: fix some manpage references 2023-01-03 14:03:35 +01:00
Naïm Favier f61e538c43
nixos/make-options-doc: link manpages
Add links to manpages without a link using the mapping defined in
`doc/manpage-urls.json`, as is already done for the nixpkgs and NixOS
manuals.
2023-01-03 14:03:35 +01:00