1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-05 07:12:34 +03:00
nixpkgs/nixos/doc/manual/from_md
sternenseemann 48965506a1 lib/asserts: use throw to display message for assertMsg
`assert` has the annoying property that it dumps a lot of code at the
user without the built in capability to display a nicer message. We have
worked around this using `assertMsg` which would *additionally* display
a nice message. We can do even better: By using `throw` we can make
evaluation fail before assert draws its conclusions and prevent it from
displaying the code making up the assert condition, so we get the nicer
message of `throw` and the syntactical convenience of `assert`.

Before:

    nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; }
    trace: Deterministic builds require stripping bytecode.
    error: assertion (((lib).assertMsg  (reproducibleBuild -> stripBytecode))  "Deterministic builds require stripping bytecode.") failed at /home/lukas/src/nix/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix:45:1

After:

    nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; }
    error: Deterministic builds require stripping bytecode.
2022-01-19 00:50:06 +01:00
..
administration postgresql_9_6: drop 2021-12-03 01:14:29 +01:00
configuration nixos/doc: improve example of renaming network interfaces 2021-11-21 20:12:31 -08:00
development Merge pull request #146905 from Synthetica9/failure_mode 2022-01-08 18:28:25 +01:00
installation [21.11] update README.md 2021-11-29 20:15:35 -05:00
release-notes lib/asserts: use throw to display message for assertMsg 2022-01-19 00:50:06 +01:00
contributing-to-this-manual.chapter.xml nixos/doc: convert "Contributing to this manual" to CommonMark 2021-05-22 18:14:49 -07:00
README.md

This directory is temporarily needed while we transition the manual to CommonMark. It stores the output of the ../md-to-db.sh script that converts CommonMark files back to DocBook.

We are choosing to convert the Markdown to DocBook at authoring time instead of manual building time, because we do not want the pandoc toolchain to become part of the NixOS closure.

Do not edit the DocBook files inside this directory or its subdirectories. Instead, edit the corresponding .md file in the normal manual directories, and run ../md-to-db.sh to update the file here.