From 2e751c0772b9d48ff6923569adfa661b030ab6a2 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 28 Jul 2022 23:19:15 +0200 Subject: 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 and , so any option using such tags will not be converted at all. --- nixos/modules/services/security/usbguard.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'nixos/modules/services/security/usbguard.nix') diff --git a/nixos/modules/services/security/usbguard.nix b/nixos/modules/services/security/usbguard.nix index 201b37f17ba..eb3c335d974 100644 --- a/nixos/modules/services/security/usbguard.nix +++ b/nixos/modules/services/security/usbguard.nix @@ -45,9 +45,9 @@ in type = types.package; default = pkgs.usbguard; defaultText = literalExpression "pkgs.usbguard"; - description = '' + description = lib.mdDoc '' The usbguard package to use. If you do not need the Qt GUI, use - pkgs.usbguard-nox to save disk space. + `pkgs.usbguard-nox` to save disk space. ''; }; @@ -78,7 +78,7 @@ in implictPolicyTarget = mkOption { type = policy; default = "block"; - description = '' + description = lib.mdDoc '' How to treat USB devices that don't match any rule in the policy. Target should be one of allow, block or reject (logically remove the device node from the system). @@ -88,7 +88,7 @@ in presentDevicePolicy = mkOption { type = policy; default = "apply-policy"; - description = '' + description = lib.mdDoc '' How to treat USB devices that are already connected when the daemon starts. Policy should be one of allow, block, reject, keep (keep whatever state the device is currently in) or apply-policy (evaluate @@ -99,7 +99,7 @@ in presentControllerPolicy = mkOption { type = policy; default = "keep"; - description = '' + description = lib.mdDoc '' How to treat USB controller devices that are already connected when the daemon starts. One of allow, block, reject, keep or apply-policy. ''; @@ -108,7 +108,7 @@ in insertedDevicePolicy = mkOption { type = policy; default = "apply-policy"; - description = '' + description = lib.mdDoc '' How to treat USB devices that are already connected after the daemon starts. One of block, reject, apply-policy. ''; @@ -117,7 +117,7 @@ in restoreControllerDeviceState = mkOption { type = types.bool; default = false; - description = '' + description = lib.mdDoc '' The USBGuard daemon modifies some attributes of controller devices like the default authorization state of new child device instances. Using this setting, you can controll whether the daemon @@ -130,7 +130,7 @@ in type = types.listOf types.str; default = [ "root" ]; example = [ "root" "yourusername" ]; - description = '' + description = lib.mdDoc '' A list of usernames that the daemon will accept IPC connections from. ''; }; @@ -139,7 +139,7 @@ in type = types.listOf types.str; default = [ ]; example = [ "wheel" ]; - description = '' + description = lib.mdDoc '' A list of groupnames that the daemon will accept IPC connections from. ''; @@ -148,7 +148,7 @@ in deviceRulesWithPort = mkOption { type = types.bool; default = false; - description = '' + description = lib.mdDoc '' Generate device specific rules including the "via-port" attribute. ''; }; -- cgit 1.4.1