nixpkgs/nixos/modules/services
Silvan Mosberger 1d0fc9729d
nixos/treewide: Fix incorrectly rendered examples
Many options define their example to be a Nix value without using
literalExample. This sometimes gets rendered incorrectly in the manual,
causing confusion like in https://github.com/NixOS/nixpkgs/issues/25516

This fixes it by using literalExample for such options. The list of
option to fix was determined with this expression:

  let
    nixos = import ./nixos { configuration = {}; };
    lib = import ./lib;
    valid = d: {
      # escapeNixIdentifier from https://github.com/NixOS/nixpkgs/pull/82461
      set = lib.all (n: lib.strings.escapeNixIdentifier n == n) (lib.attrNames d) && lib.all (v: valid v) (lib.attrValues d);
      list = lib.all (v: valid v) d;
    }.${builtins.typeOf d} or true;

    optionList = lib.optionAttrSetToDocList nixos.options;

  in map (opt: {
    file = lib.elemAt opt.declarations 0;
    loc = lib.options.showOption opt.loc;
  }) (lib.filter (opt: if opt ? example then ! valid opt.example else false) optionList)

which when evaluated will output all options that use a Nix identifier
that would need escaping as an attribute name.
2020-04-02 07:49:25 +02:00
..
admin nixos/oxidized: add missing slash to PIDFile path 2020-01-06 16:58:54 +01:00
amqp nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
audio nixos/alsa: replace list by attrset in environment.etc 2020-02-14 01:17:18 +01:00
backup nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
cluster nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
computing folding@home: 6.02 -> 7.5.1 2020-03-14 13:01:26 -07:00
continuous-integration Merge pull request #74379 from bachp/gitlab-runner-reload 2020-03-31 20:18:28 +02:00
databases Merge pull request #82739 from danbst/document-postgresql-upgrade 2020-03-31 23:50:06 +02:00
desktops nixos: add freedesktop/gnome/myself maintainers 2020-04-01 20:53:09 -04:00
development nixos/jupyter: Fix documentation example for jupyter.kernels (#56415) 2020-01-31 15:30:02 +01:00
editors treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
games nixos/factorio: add extraSettings and package options 2020-01-10 23:36:14 +00:00
hardware xow: 0.2 -> 0.4 2020-03-31 17:24:37 +03:00
logging treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
mail nixos/magic-wormhole-mailbox-server: moving from mail to networking 2020-03-31 16:29:39 +02:00
misc Remove unused 'rogue' service 2020-03-24 15:25:20 +01:00
monitoring Merge pull request #82808 from nlewo/fix-alertmanager 2020-03-28 09:29:01 +01:00
network-filesystems nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
networking nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
printing treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
scheduling atd: systemd-udev-settle serves no purpose 2020-03-21 11:15:06 +08:00
search solr: drop 7.x series 2020-01-18 08:50:35 -05:00
security fail2ban: fix firewall warning 2020-03-22 18:11:36 +01:00
system treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
torrent nixos/transmission: Allow others to read the directory 2020-02-24 08:03:21 +01:00
ttys treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
wayland nixos/cage: move ConditionPathExists to service config 2020-03-09 00:47:49 +01:00
web-apps nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
web-servers Merge pull request #82784 from davidak/fpm 2020-03-28 22:22:24 -04:00
x11 Merge pull request #84037 from worldofpeace/remove-none.nix 2020-04-01 22:00:47 -04:00