From d041641b1abc901191947cd9d7676cd803ccd00b Mon Sep 17 00:00:00 2001 From: pennae Date: Wed, 8 Feb 2023 11:08:25 +0100 Subject: 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. --- .../from_md/development/assertions.section.xml | 58 ---------------------- 1 file changed, 58 deletions(-) delete mode 100644 nixos/doc/manual/from_md/development/assertions.section.xml (limited to 'nixos/doc/manual/from_md/development/assertions.section.xml') diff --git a/nixos/doc/manual/from_md/development/assertions.section.xml b/nixos/doc/manual/from_md/development/assertions.section.xml deleted file mode 100644 index 13f04d5d188..00000000000 --- a/nixos/doc/manual/from_md/development/assertions.section.xml +++ /dev/null @@ -1,58 +0,0 @@ -
- Warnings and Assertions - - When configuration problems are detectable in a module, it is a good - idea to write an assertion or warning. Doing so provides clear - feedback to the user and prevents errors after the build. - - - Although Nix has the abort and - builtins.trace - functions - to perform such tasks, they are not ideally suited for NixOS - modules. Instead of these functions, you can declare your warnings - and assertions using the NixOS module system. - -
- Warnings - - This is an example of using warnings. - - -{ config, lib, ... }: -{ - config = lib.mkIf config.services.foo.enable { - warnings = - if config.services.foo.bar - then [ ''You have enabled the bar feature of the foo service. - This is known to cause some specific problems in certain situations. - '' ] - else []; - } -} - -
-
- Assertions - - This example, extracted from the - syslogd - module shows how to use assertions. - Since there can only be one active syslog daemon at a time, an - assertion is useful to prevent such a broken system from being - built. - - -{ config, lib, ... }: -{ - config = lib.mkIf config.services.syslogd.enable { - assertions = - [ { assertion = !config.services.rsyslogd.enable; - message = "rsyslogd conflicts with syslogd"; - } - ]; - } -} - -
-
-- cgit 1.4.1