1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00

treewide: make option descriptions constants

escape interpolations in descriptions where possible, replace them with
sufficiently descriptive text elsewhere. also expand cfg.* paths in
descriptions.
This commit is contained in:
pennae 2021-12-05 21:58:27 +01:00
parent ed673a69db
commit e72435e612
8 changed files with 22 additions and 16 deletions

View file

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.services.terraria;
opt = options.services.terraria;
worldSizeMap = { small = 1; medium = 2; large = 3; };
valFlag = name: val: optionalString (val != null) "-${name} \"${escape ["\\" "\""] (toString val)}\"";
boolFlag = name: val: optionalString val "-${name}";
@ -36,7 +37,7 @@ in
type = types.bool;
default = false;
description = ''
If enabled, starts a Terraria server. The server can be connected to via <literal>tmux -S ${cfg.dataDir}/terraria.sock attach</literal>
If enabled, starts a Terraria server. The server can be connected to via <literal>tmux -S ''${config.${opt.dataDir}}/terraria.sock attach</literal>
for administration by users who are a part of the <literal>terraria</literal> group (use <literal>C-b d</literal> shortcut to detach again).
'';
};

View file

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.services.airsonic;
opt = options.services.airsonic;
in {
options = {
@ -78,7 +79,7 @@ in {
description = ''
List of paths to transcoder executables that should be accessible
from Airsonic. Symlinks will be created to each executable inside
${cfg.home}/transcoders.
''${config.${opt.home}}/transcoders.
'';
};

View file

@ -277,13 +277,13 @@ in {
user = mkOption {
type = types.str;
default = "mediatomb";
description = "User account under which ${name} runs.";
description = "User account under which the service runs.";
};
group = mkOption {
type = types.str;
default = "mediatomb";
description = "Group account under which ${name} runs.";
description = "Group account under which the service runs.";
};
port = mkOption {
@ -340,7 +340,7 @@ in {
type = types.bool;
default = false;
description = ''
Allow ${name} to create and use its own config file inside the <literal>dataDir</literal> as
Allow the service to create and use its own config file inside the <literal>dataDir</literal> as
configured by <option>services.mediatomb.dataDir</option>.
Deactivated by default, the service then runs with the configuration generated from this module.
Otherwise, when enabled, no service configuration is generated. Gerbera/Mediatomb then starts using

View file

@ -1,8 +1,11 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let cfg = config.services.subsonic; in {
let
cfg = config.services.subsonic;
opt = options.services.subsonic;
in {
options = {
services.subsonic = {
enable = mkEnableOption "Subsonic daemon";
@ -97,7 +100,7 @@ let cfg = config.services.subsonic; in {
description = ''
List of paths to transcoder executables that should be accessible
from Subsonic. Symlinks will be created to each executable inside
${cfg.home}/transcoders.
''${config.${opt.home}}/transcoders.
'';
};
};

View file

@ -171,7 +171,7 @@ in {
example = "/storage/tank";
description = ''
ZoneMinder can generate quite a lot of data, so in case you don't want
to use the default ${home}, you can override the path here.
to use the default ${defaultDir}, you can override the path here.
'';
};

View file

@ -1,10 +1,11 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.services.ntopng;
opt = options.services.ntopng;
redisCfg = config.services.redis;
configFile = if cfg.configText != "" then
@ -35,8 +36,8 @@ in
collection tool.
With the default configuration, ntopng monitors all network
interfaces and displays its findings at http://localhost:${toString
cfg.http-port}. Default username and password is admin/admin.
interfaces and displays its findings at http://localhost:''${toString
config.${opt.http-port}}. Default username and password is admin/admin.
See the ntopng(8) manual page and http://www.ntop.org/products/ntop/
for more info.

View file

@ -33,7 +33,7 @@ in
type = types.listOf types.str;
default = [];
description = ''
Groups to which the user ${name} should be added.
Groups to which the service user should be added.
'';
};

View file

@ -83,7 +83,7 @@ in {
default = "${user}.${fqdn}";
example = "matomo.yourdomain.org";
description = ''
URL of the host, without https prefix. By default, this is ${user}.${fqdn}, but you may want to change it if you
URL of the host, without https prefix. You may want to change it if you
run Matomo on a different URL than matomo.yourdomain.
'';
};