0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

treewide: automatically md-convert option descriptions

the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
This commit is contained in:
pennae 2022-07-28 23:19:15 +02:00
parent 52b0ad17e3
commit 2e751c0772
1050 changed files with 9605 additions and 9605 deletions

View file

@ -102,7 +102,7 @@ in
type = types.str;
default = "syncoid";
example = "backup";
description = ''
description = lib.mdDoc ''
The user for the service. ZFS privilege delegation will be
automatically configured for any local pools used by syncoid if this
option is set to a user other than root. The user will be given the
@ -116,7 +116,7 @@ in
type = types.str;
default = "syncoid";
example = "backup";
description = "The group for the service.";
description = lib.mdDoc "The group for the service.";
};
sshKey = mkOption {
@ -124,7 +124,7 @@ in
# Prevent key from being copied to store
apply = mapNullable toString;
default = null;
description = ''
description = lib.mdDoc ''
SSH private key file to use to login to the remote system. Can be
overridden in individual commands.
'';
@ -134,10 +134,10 @@ in
type = types.listOf types.str;
# Permissions snapshot and destroy are in case --no-sync-snap is not used
default = [ "bookmark" "hold" "send" "snapshot" "destroy" ];
description = ''
Permissions granted for the <option>services.syncoid.user</option> user
description = lib.mdDoc ''
Permissions granted for the {option}`services.syncoid.user` user
for local source datasets. See
<link xlink:href="https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html"/>
<https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html>
for available permissions.
'';
};
@ -146,13 +146,13 @@ in
type = types.listOf types.str;
default = [ "change-key" "compression" "create" "mount" "mountpoint" "receive" "rollback" ];
example = [ "create" "mount" "receive" "rollback" ];
description = ''
Permissions granted for the <option>services.syncoid.user</option> user
description = lib.mdDoc ''
Permissions granted for the {option}`services.syncoid.user` user
for local target datasets. See
<link xlink:href="https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html"/>
<https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html>
for available permissions.
Make sure to include the <literal>change-key</literal> permission if you send raw encrypted datasets,
the <literal>compression</literal> permission if you send raw compressed datasets, and so on.
Make sure to include the `change-key` permission if you send raw encrypted datasets,
the `compression` permission if you send raw compressed datasets, and so on.
For remote target datasets you'll have to set your remote user permissions by yourself.
'';
};
@ -161,10 +161,10 @@ in
type = types.listOf types.str;
default = [ ];
example = [ "--no-sync-snap" ];
description = ''
description = lib.mdDoc ''
Arguments to add to every syncoid command, unless disabled for that
command. See
<link xlink:href="https://github.com/jimsalterjrs/sanoid/#syncoid-command-line-options"/>
<https://github.com/jimsalterjrs/sanoid/#syncoid-command-line-options>
for available options.
'';
};
@ -172,7 +172,7 @@ in
service = mkOption {
type = types.attrs;
default = { };
description = ''
description = lib.mdDoc ''
Systemd configuration common to all syncoid services.
'';
};
@ -183,7 +183,7 @@ in
source = mkOption {
type = types.str;
example = "pool/dataset";
description = ''
description = lib.mdDoc ''
Source ZFS dataset. Can be either local or remote. Defaults to
the attribute name.
'';
@ -205,32 +205,32 @@ in
type = types.nullOr types.path;
# Prevent key from being copied to store
apply = mapNullable toString;
description = ''
description = lib.mdDoc ''
SSH private key file to use to login to the remote system.
Defaults to <option>services.syncoid.sshKey</option> option.
Defaults to {option}`services.syncoid.sshKey` option.
'';
};
localSourceAllow = mkOption {
type = types.listOf types.str;
description = ''
Permissions granted for the <option>services.syncoid.user</option> user
description = lib.mdDoc ''
Permissions granted for the {option}`services.syncoid.user` user
for local source datasets. See
<link xlink:href="https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html"/>
<https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html>
for available permissions.
Defaults to <option>services.syncoid.localSourceAllow</option> option.
Defaults to {option}`services.syncoid.localSourceAllow` option.
'';
};
localTargetAllow = mkOption {
type = types.listOf types.str;
description = ''
Permissions granted for the <option>services.syncoid.user</option> user
description = lib.mdDoc ''
Permissions granted for the {option}`services.syncoid.user` user
for local target datasets. See
<link xlink:href="https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html"/>
<https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html>
for available permissions.
Make sure to include the <literal>change-key</literal> permission if you send raw encrypted datasets,
the <literal>compression</literal> permission if you send raw compressed datasets, and so on.
Make sure to include the `change-key` permission if you send raw encrypted datasets,
the `compression` permission if you send raw compressed datasets, and so on.
For remote target datasets you'll have to set your remote user permissions by yourself.
'';
};
@ -239,7 +239,7 @@ in
type = types.separatedString " ";
default = "";
example = "Lc e";
description = ''
description = lib.mdDoc ''
Advanced options to pass to zfs send. Options are specified
without their leading dashes and separated by spaces.
'';
@ -249,7 +249,7 @@ in
type = types.separatedString " ";
default = "";
example = "ux recordsize o compression=lz4";
description = ''
description = lib.mdDoc ''
Advanced options to pass to zfs recv. Options are specified
without their leading dashes and separated by spaces.
'';
@ -258,7 +258,7 @@ in
useCommonArgs = mkOption {
type = types.bool;
default = true;
description = ''
description = lib.mdDoc ''
Whether to add the configured common arguments to this command.
'';
};
@ -266,7 +266,7 @@ in
service = mkOption {
type = types.attrs;
default = { };
description = ''
description = lib.mdDoc ''
Systemd configuration specific to this syncoid service.
'';
};
@ -275,7 +275,7 @@ in
type = types.listOf types.str;
default = [ ];
example = [ "--sshport 2222" ];
description = "Extra syncoid arguments for this command.";
description = lib.mdDoc "Extra syncoid arguments for this command.";
};
};
config = {
@ -291,7 +291,7 @@ in
"pool/test".target = "root@target:pool/test";
}
'';
description = "Syncoid commands to run.";
description = lib.mdDoc "Syncoid commands to run.";
};
};