summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2021-12-05 21:58:27 +0100
committerpennae <github@quasiparticle.net>2021-12-09 01:21:04 +0100
commite72435e6125f51a5f331080ed1862bdc86d36769 (patch)
tree69f8c218e9329deb848e5c21b842e007ccae6da4
parented673a69dbf5f9be67183621eb0f5c1759d48299 (diff)
treewide: make option descriptions constants
escape interpolations in descriptions where possible, replace them with sufficiently descriptive text elsewhere. also expand cfg.* paths in descriptions.
-rw-r--r--nixos/modules/services/games/terraria.nix5
-rw-r--r--nixos/modules/services/misc/airsonic.nix5
-rw-r--r--nixos/modules/services/misc/mediatomb.nix6
-rw-r--r--nixos/modules/services/misc/subsonic.nix9
-rw-r--r--nixos/modules/services/misc/zoneminder.nix2
-rw-r--r--nixos/modules/services/networking/ntopng.nix7
-rw-r--r--nixos/modules/services/web-apps/hedgedoc.nix2
-rw-r--r--nixos/modules/services/web-apps/matomo.nix2
8 files changed, 22 insertions, 16 deletions
diff --git a/nixos/modules/services/games/terraria.nix b/nixos/modules/services/games/terraria.nix
index 7312c7e6b635..29f976b3c2ae 100644
--- a/nixos/modules/services/games/terraria.nix
+++ b/nixos/modules/services/games/terraria.nix
@@ -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).
'';
};
diff --git a/nixos/modules/services/misc/airsonic.nix b/nixos/modules/services/misc/airsonic.nix
index 533a3d367a32..5a5c30a41233 100644
--- a/nixos/modules/services/misc/airsonic.nix
+++ b/nixos/modules/services/misc/airsonic.nix
@@ -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.
'';
};
diff --git a/nixos/modules/services/misc/mediatomb.nix b/nixos/modules/services/misc/mediatomb.nix
index 383090575b22..0227e81cfd93 100644
--- a/nixos/modules/services/misc/mediatomb.nix
+++ b/nixos/modules/services/misc/mediatomb.nix
@@ -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
diff --git a/nixos/modules/services/misc/subsonic.nix b/nixos/modules/services/misc/subsonic.nix
index 98b85918ad18..2dda8970dd30 100644
--- a/nixos/modules/services/misc/subsonic.nix
+++ b/nixos/modules/services/misc/subsonic.nix
@@ -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.
'';
};
};
diff --git a/nixos/modules/services/misc/zoneminder.nix b/nixos/modules/services/misc/zoneminder.nix
index 378da7b87442..407742f72ad5 100644
--- a/nixos/modules/services/misc/zoneminder.nix
+++ b/nixos/modules/services/misc/zoneminder.nix
@@ -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.
'';
};
diff --git a/nixos/modules/services/networking/ntopng.nix b/nixos/modules/services/networking/ntopng.nix
index c15257117137..77a004e8ab3a 100644
--- a/nixos/modules/services/networking/ntopng.nix
+++ b/nixos/modules/services/networking/ntopng.nix
@@ -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.
diff --git a/nixos/modules/services/web-apps/hedgedoc.nix b/nixos/modules/services/web-apps/hedgedoc.nix
index e0c00fe67ea3..9eeabb9d5662 100644
--- a/nixos/modules/services/web-apps/hedgedoc.nix
+++ b/nixos/modules/services/web-apps/hedgedoc.nix
@@ -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.
'';
};
diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix
index eba55e7e9bef..318c4473b552 100644
--- a/nixos/modules/services/web-apps/matomo.nix
+++ b/nixos/modules/services/web-apps/matomo.nix
@@ -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.
'';
};