1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 14:41:17 +00:00
nixpkgs/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 [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
azure-config.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
azure-image.nix azure: init nixos/maintainers/scripts/azure-new 2020-03-29 13:56:55 -07:00
azure-images.nix
brightbox-config.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
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 nixos/docker-image: add example usage 2018-11-23 15:40:10 +00:00
docker-preloader.nix nixos/dockerPreloader: guard the entire implemetation with mkIf on image list 2019-02-11 23:35:25 +01:00
docker.nix docker: fix typo 2019-05-22 08:40:01 -07:00
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 nixos: Add ec2-metadata-fetcher.nix file 2019-02-11 20:58:45 +01:00
ecs-agent.nix
gce-images.nix Update GCE image for 18.09 2018-11-16 11:43:42 +01:00
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 treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
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 [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
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 openstackImage: set the / fsType to reenable root FS resizing 2019-03-21 10:04:07 +01:00
openvswitch.nix openvswitch: better integration with systemd 2019-12-15 21:16:26 +01:00
parallels-guest.nix nixos: Don't set LD_LIBRARY_PATH for graphics drivers that don't need it. 2019-05-26 10:23:46 +02:00
qemu-guest-agent.nix nixos/qemu-guest-agent: pkgs.{kvm -> qemu} (#48293) 2018-10-13 00:41:46 +02:00
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 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
virtualbox-guest.nix reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
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 nixos: correct improper uses of mkEnableOption, clarify service descriptions 2018-10-05 13:14:45 +07:00
xen-dom0.nix treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
xen-domU.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00