nixpkgs-suyu/nixos/modules/virtualisation
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
..
amazon-image.nix ec2-utils: init at 0.5.1, include in amazon-image profile (#67347) 2019-11-01 20:57:44 +00:00
amazon-init.nix nixos/amazon-init.nix: Add gzip to amazon-init path 2020-01-23 14:15:26 +01:00
amazon-options.nix amazon-image.nix: add EFI support, enable by default for aarch64 2019-09-05 00:52:17 +09:00
anbox.nix nixos/modules: Remove all usages of types.string 2019-08-31 18:19:00 +02:00
azure-agent-entropy.patch
azure-agent.nix nixos: remove dependencies on local-fs.target 2019-09-01 19:06:38 +02:00
azure-bootstrap-blobs.nix
azure-common.nix azure: boot.growPartition = true 2020-03-29 13:56:55 -07:00
azure-config-user.nix
azure-config.nix
azure-image.nix azure: init nixos/maintainers/scripts/azure-new 2020-03-29 13:56:55 -07:00
azure-images.nix
brightbox-config.nix
brightbox-image.nix treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
cloudstack-config.nix treewide: remove unused variables (#63177) 2019-06-16 19:59:05 +00:00
container-config.nix nixos containers: disable NixOS manual in container config. (#75659) 2019-12-15 18:21:52 +02:00
containers.nix nixos/treewide: Fix incorrectly rendered examples 2020-04-02 07:49:25 +02:00
cri-o.nix Add cri-o service to modules (#68153) 2019-09-21 14:18:42 +00:00
digital-ocean-config.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
digital-ocean-image.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
digital-ocean-init.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
docker-containers.nix nixos/docker-containers: Move ExecStartPre/ExecStopPost to preStart/postStop 2020-02-15 23:16:43 +01:00
docker-image.nix
docker-preloader.nix
docker.nix
ec2-amis.nix ec2-amis.nix: add 19.09 amis 2019-10-28 14:04:20 -04:00
ec2-data.nix nixos/treewide: Move rename.nix imports to their respective modules 2019-12-10 02:51:19 +01:00
ec2-metadata-fetcher.nix
ecs-agent.nix
gce-images.nix
google-compute-config.nix google-compute-config.nix: use sysctl snippets from gce 2019-09-01 02:55:28 +02:00
google-compute-image.nix
grow-partition.nix
hyperv-guest.nix nixos/virtualisation.hypervGuest: use elevator=noop 2020-02-09 19:50:13 +01:00
kvmgt.nix nixos/kvmgt: add udev rules for unprivileged access 2020-03-13 07:04:26 +00:00
libvirtd.nix libvirt: fix escapeShellArg usage 2020-03-30 09:45:28 +00:00
lxc-container.nix
lxc.nix lxc: Fix lxc-usernet(5) man page reference in documentation 2019-12-17 15:37:36 -08:00
lxcfs.nix
lxd.nix lxd: also use default text for other package options 2020-01-30 14:26:54 +00:00
openstack-config.nix
openvswitch.nix openvswitch: better integration with systemd 2019-12-15 21:16:26 +01:00
parallels-guest.nix
qemu-guest-agent.nix
qemu-vm.nix connman: move options to services 2019-11-24 16:23:32 -05:00
railcar.nix nixos/railcar: remove use of the deprecated string type 2019-09-06 14:53:11 +00:00
rkt.nix
virtualbox-guest.nix
virtualbox-host.nix nixos/virtualbox: fix systemd-networkd-wait-online.service waiting for vboxnet0 2019-10-26 00:45:42 +02:00
virtualbox-image.nix nixos/virtualbox-image: add params 2020-02-21 16:53:32 +01:00
vmware-guest.nix nixos/treewide: Move rename.nix imports to their respective modules 2019-12-10 02:51:19 +01:00
xe-guest-utilities.nix
xen-dom0.nix treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
xen-domU.nix