From 1460db45f63a3d402aaff35b7463805c2b6d98a1 Mon Sep 17 00:00:00 2001 From: codgician <15964984+codgician@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:12:00 +0800 Subject: [PATCH] waagent: optimize option descriptions --- nixos/modules/virtualisation/waagent.nix | 70 +++++++++++++++--------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/nixos/modules/virtualisation/waagent.nix b/nixos/modules/virtualisation/waagent.nix index 8baa8381c294..5d08bb544b3d 100644 --- a/nixos/modules/virtualisation/waagent.nix +++ b/nixos/modules/virtualisation/waagent.nix @@ -110,14 +110,18 @@ let }; ResourceDisk = { - Format = mkEnableOption '' - If set to `true`, waagent formats and mounts the resource disk that the platform provides, - unless the file system type in `ResourceDisk.FileSystem` is set to `ntfs`. - The agent makes a single Linux partition (ID 83) available on the disk. - This partition isn't formatted if it can be successfully mounted. + Format = mkOption { + type = types.bool; + default = false; + description = '' + If set to `true`, waagent formats and mounts the resource disk that the platform provides, + unless the file system type in `ResourceDisk.FileSystem` is set to `ntfs`. + The agent makes a single Linux partition (ID 83) available on the disk. + This partition isn't formatted if it can be successfully mounted. - This configuration has no effect if resource disk is managed by cloud-init. - ''; + This configuration has no effect if resource disk is managed by cloud-init. + ''; + }; FileSystem = mkOption { type = types.str; @@ -155,12 +159,16 @@ let ''; }; - EnableSwap = mkEnableOption '' - If enabled, the agent creates a swap file (`/swapfile`) on the resource disk - and adds it to the system swap space. + EnableSwap = mkOption { + type = types.bool; + default = false; + description = '' + If enabled, the agent creates a swap file (`/swapfile`) on the resource disk + and adds it to the system swap space. - This configuration has no effect if resource disk is managed by cloud-init. - ''; + This configuration has no effect if resource disk is managed by cloud-init. + ''; + }; SwapSizeMB = mkOption { type = types.int; @@ -173,16 +181,24 @@ let }; }; - Logs.Verbose = lib.mkEnableOption '' - If you set this option, log verbosity is boosted. - Waagent logs to `/var/log/waagent.log` and uses the system logrotate functionality to rotate logs. - ''; + Logs.Verbose = lib.mkOption { + type = types.bool; + default = false; + description = '' + If you set this option, log verbosity is boosted. + Waagent logs to `/var/log/waagent.log` and uses the system logrotate functionality to rotate logs. + ''; + }; OS = { - EnableRDMA = lib.mkEnableOption '' - If enabled, the agent attempts to install and then load an RDMA kernel driver - that matches the version of the firmware on the underlying hardware. - ''; + EnableRDMA = lib.mkOption { + type = types.bool; + default = false; + description = '' + If enabled, the agent attempts to install and then load an RDMA kernel driver + that matches the version of the firmware on the underlying hardware. + ''; + }; RootDeviceScsiTimeout = lib.mkOption { type = types.nullOr types.int; @@ -212,17 +228,19 @@ let }; }; - AutoUpdate.Enable = lib.mkEnableOption '' - Enable or disable autoupdate for goal state processing. - ''; + AutoUpdate.Enable = lib.mkOption { + type = types.bool; + default = false; + description = '' + Whether or not to enable autoupdate for goal state processing. + ''; + }; }; }; in { options.services.waagent = { - enable = lib.mkEnableOption '' - Whether to enable the Windows Azure Linux Agent. - ''; + enable = lib.mkEnableOption "Windows Azure Linux Agent"; package = lib.mkPackageOption pkgs "waagent" { };