Commit graph

289 commits

Author SHA1 Message Date
Janne Heß 85c1c30fd9
nixos/switch-to-configuration: Never unmount / or /nix
Also adds a huge test for fstab handling
2023-09-22 10:26:10 +02:00
Janne Heß eb831f759b
nixos/stc: Improve mount unit handling
We should sometimes restart the units rather than reloading them so the
changes are actually applied. / and /nix are explicitly excluded because
there was some very old issue where these were unmounted. I don't think
this will affect many people since most people use fstab mounts instead
but I plan to adapt this behavior for fstab mounts as well in the future
(once I wrote a test for the fstab thingies).
2023-08-21 09:07:14 +02:00
Jacek Galowicz 846ad444c7 integration test driver: Auto-generate integration test driver's machine
method documentation of nixos docs from python doc strings
2023-07-10 08:51:52 +02:00
Naïm Favier 14d3e5685a
lib/types: add pathInStore 2023-06-27 11:48:08 +02:00
Robert Hensing 16d594a0e2 lib.types.pkgs: init
A nominal type.
2023-05-10 15:55:08 +02:00
Jacek Galowicz 3ba45b082e
Merge pull request #228111 from alyssais/nixosTest-hostname
nixosTest: remove hostname limitations
2023-05-05 08:12:36 +02:00
pennae 407f6196a2 nixos-render-docs: add examples support
the nixos manual contains enough examples to support them as a proper
toc entity with specialized rendering, and if in the future the nixpkgs
wants to use nixos-render-docs we will definitely have to support them.
this also allows us to restore some examples that were lost in previous
translation steps because there were too few to add renderer support
back then.
2023-05-03 19:58:21 +02:00
Robert Hensing 3ec3d283c5 nixos/tests: extra-python-packages -> nixos-test-driver/extra-python-packages
Categorizing the tests for the test driver helps with testing the test driver.
2023-04-25 12:03:15 +02:00
Alyssa Ross d6e84a4574
nixosTest: remove hostname limitations 2023-04-25 08:55:30 +00:00
Robert Hensing 6b79fe8cdc
Merge pull request #211855 from hercules-ci/lib-modules-disabledModules-module-with-key
lib/modules: Allow an "anonymous" module with key in disabledModules
2023-03-09 16:16:37 +01:00
Robert Hensing 118bdf25a6 lib/modules: Allow an "anonymous" module with key in disabledModules
This makes the following work

    disabledModules = [ foo.nixosModules.bar ];

even if `bar` is not a path, but rather a module such as

    { key = "/path/to/foo#nixosModules.bar"; config = ...; }

By supporting this, the user will often be able to use the same syntax
for both importing and disabling a module. This is becoming more relevant
because flakes promote the use of attributes to reference modules. Not
all of these modules in flake attributes will be identifiable, but with
the help of a framework such as flake-parts, these attributes can be
guaranteed to be identifiable (by outPath + attribute path).
2023-03-01 15:03:44 +01:00
Anselm Schüler 9769e90233 lib/options: Add more options to mkPackageOption 2023-02-26 03:00:22 +01:00
Robert Hensing 9964891440 nixos/doc: Add Developing the Test Driver 2023-02-17 18:06:02 +01:00
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 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 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
pennae 0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01: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 ad8d5cf731 nixos/manual: clarify mk{Enable,Package}Option MD usage
the examples were incorrect, but not catastrophically. running a docs
build would've issued a warning with the correct instructions.
2023-01-22 17:08:40 +01:00
pennae 785c0f2afa nixos/manual: mention that module chapters should use markdown 2023-01-10 10:31:59 +01:00
pennae 9da5f12ecf modules: add mkPackageOptionMD
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05 02:33:13 +01:00
Bjørn Forsman dba49a43a0 nixos/test-driver: add optional address arg to wait_for_{open,closed}_port
This is useful for testing servers configured to listen on specific
addresses.
2022-12-29 13:50:17 +01:00
Naïm Favier 3f6fed2e59
doc,nixos/doc: unescape ellipses
Leftovers from the CommonMark conversion.
2022-12-27 17:13:49 +01:00
Naïm Favier d11832fd96
doc,nixos/doc: unescape apostrophes
Leftovers from the CommonMark conversion.
2022-12-27 17:13:47 +01:00
figsoda 6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Raito Bezarius 11dfbee0a4 nixos/activation/bootspec: add bootspec chapter in NixOS manual 2022-12-08 13:50:05 -08:00
Naïm Favier e8927c46b8
nixos/doc: document mkOrder and friends
Add a section on ordering option definitions.

Also mention `mkDefault` in the section on `mkOverride`.

Clarify the code a bit by renaming `defaultPriority` to
`defaultOverridePriority` and introducing `defaultOrderPriority`.
2022-12-02 14:15:24 +01:00
pennae 07e5701aca nixos/manual: re-add mention of mdDoc marker 2022-11-14 16:05:44 +01:00
Robert Hensing 216c5dc10d nixos/doc: Disambiguate test option ids
Changing this later on would break external links into the manual.
2022-09-29 12:41:59 +02:00
Robert Hensing 7f0d934f9a
Merge pull request #191540 from hercules-ci/nixosTest-modular
nixosTest: make modular
2022-09-28 10:27:45 +01:00
Robert Hensing 3ce4179374 nixos/doc/writing-nixos-tests: Remove flake info for now 2022-09-24 17:42:53 +01:00
Robert Hensing 7cdc9bc340 nixos/testing: Improve interactive docs 2022-09-24 17:42:52 +01:00
Robert Hensing 6a78b41476 nixos/doc/writing-nixos-tests: Various improvements
Thanks to fricklerhandwerk for the many suggestions, most of which
I have fixupped into preceding commits.
2022-09-24 17:38:11 +01:00
Robert Hensing b2caf7965c nixos/doc/writing-nixos-tests: Clarify working directory
Co-authored-by: christian-burger <christian@krikkel.de>
2022-09-24 17:38:11 +01:00
Robert Hensing ac03757eb2 nixos/doc: Wire up the test options reference 2022-09-24 17:38:10 +01:00
Robert Hensing 6205d37747 nixos/testing: Improve option docs 2022-09-24 17:38:10 +01:00
Robert Hensing 537f456373 nixos/doc/running-nixos-tests: Simplify running instructions with nixosTests 2022-09-24 17:38:08 +01:00
Robert Hensing 6e2f753989 nixos/doc/running-nixos-tests-interactively: Describe interactive option 2022-09-24 17:38:08 +01:00
Robert Hensing b0c781cc41 nixos/testing: Move entrypoint to nixos/lib + doc 2022-09-24 17:38:08 +01:00
maralorn fae2ff5c03 haskell.{compiler,packages}: Add aliases without minor versions 2022-09-21 05:51:28 +02:00
pennae 767485a0de lib/options: deprecate docbook text and literalDocBook
deprecate literalDocBook by adding a warning (that will not fire yet) to
its uses and other docbook literal strings by adding optional warning
message to mergeJSON.
2022-09-10 18:23:13 +02:00
Silvan Mosberger 6389a26e5f
Merge pull request #181834 from ncfavier/numbers
lib/types: add `number`
2022-09-09 19:59:29 +02:00
Naïm Favier 52bbbaeb09
nixos/doc/option-types: add precision loss warning for floats 2022-09-09 15:39:35 +02:00
github-actions[bot] 9b65c7a2b7
Merge master into haskell-updates 2022-08-04 00:13:57 +00:00
Brian Leung feddd5e7f8
manual: fix typos 2022-07-29 11:20:55 -07:00
sternenseemann 7f909b041b haskell.compiler: ghc923 -> ghc924
https://www.haskell.org/ghc/download_ghc_9_2_4.html
2022-07-28 18:09:33 +02:00