Skip to content
This repository was archived by the owner on Sep 14, 2025. It is now read-only.

Commit 5ecd3fd

Browse files
committed
chore: add descriptions to nixos options
1 parent 0cccdb2 commit 5ecd3fd

20 files changed

+451
-118
lines changed

modules/acme.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,30 @@
88
useStagingEnvironment = lib.mkOption {
99
type = lib.types.bool;
1010
default = false;
11+
description = ''
12+
Whether to use the Let's Encrypt staging environment.
13+
The staging environment has much higher rate limits, making it ideal for testing,
14+
but the certificates it issues are not trusted by browsers or other clients.
15+
Enable this during development or testing to avoid hitting production rate limits.
16+
'';
1117
};
1218
acmeMail = lib.mkOption {
1319
type = lib.types.str;
1420
default = "[email protected]";
21+
description = ''
22+
The email address to associate with certificate requests to Let's Encrypt.
23+
This is used for important account notifications, such as expiry warnings,
24+
and may be required by some ACME servers for registration.
25+
'';
1526
};
1627
renewalNetNs = lib.mkOption {
1728
type = with lib.types; nullOr str;
1829
default = null;
30+
description = ''
31+
The network namespace in which the ACME systemd services will run.
32+
If unset, the service runs in the default (global) network namespace.
33+
Example: Use a dedicated netns with unrestricted outbound traffic for Let's Encrypt.
34+
'';
1935
};
2036
};
2137
config = lib.mkIf ((builtins.length (builtins.attrNames config.security.acme.certs)) > 0) {

modules/cryptpad.nix

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,40 @@
1010
# https://docs.cryptpad.org/en/dev_guide/general.html
1111
domain = lib.mkOption {
1212
type = lib.types.str;
13-
default = "ucryptpad.${toString config.networking.fqdn}";
13+
default = "cryptpad.${toString config.networking.fqdn}";
14+
description = ''
15+
The primary (unsafe) domain where CryptPad's sensitive data layer is loaded.
16+
This URL handles encrypted user content in memory (drive, contacts, teams),
17+
and must be served over HTTPS in production.
18+
19+
Security note: Vulnerabilities in the UI won't expose this layer's data
20+
due to sandboxing, but this domain still requires strict security headers.
21+
'';
1422
};
1523
sandboxDomain = lib.mkOption {
1624
type = lib.types.str;
17-
default = "cryptpad.${toString config.networking.fqdn}";
25+
default = "sandbox.cryptpad.${toString config.networking.fqdn}";
26+
description = ''
27+
The isolated sandbox domain (loaded in an iframe) that renders the UI.
28+
This domain never receives sensitive user data - it only displays document content
29+
passed through the sandboxing system.
30+
31+
Operational note: Must share the same top-level domain as
32+
the unsafe origin for cookie/tracking purposes.
33+
'';
34+
};
35+
internal_port = lib.mkOption {
36+
type = lib.types.port;
37+
description = ''
38+
The local port the service listens on.
39+
'';
40+
};
41+
internal_ws_port = lib.mkOption {
42+
type = lib.types.port;
43+
description = ''
44+
The local port the websocket listener of the service listens on.
45+
'';
1846
};
19-
internal_port = lib.mkOption { type = lib.types.port; };
20-
internal_ws_port = lib.mkOption { type = lib.types.port; };
2147
};
2248

2349
config = lib.mkIf config.secshell.cryptpad.enable {

modules/filebeat.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
enable = lib.mkEnableOption "filebeat";
55
graylogDomain = lib.mkOption {
66
type = lib.types.str;
7+
description = ''
8+
The Graylog server domain or IP address where logs should be sent.
9+
This should include the protocol and port if different from default:
10+
- For GELF over TCP: `tcp://graylog.example.com:12201`
11+
- For HTTP/HTTPS: `https://graylog.example.com:9000/api`
12+
'';
713
};
814
};
915
config = lib.mkIf config.secshell.filebeat.enable {

modules/gitea-actions.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
options,
32
config,
43
pkgs,
54
lib,
@@ -52,6 +51,7 @@ in
5251
giteaServer = lib.mkOption {
5352
type = lib.types.str;
5453
default = config.services.gitea.settings.server.ROOT_URL;
54+
description = "The gitea server to serve gitea actions for.";
5555
};
5656

5757
storeDependencies = lib.mkOption {

modules/gitea.nix

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,106 @@ in
2020
type = types.str;
2121
default = "git.${toString config.networking.fqdn}";
2222
defaultText = "git.\${toString config.networking.fqdn}";
23+
description = ''
24+
The primary domain name for this service.
25+
Used for virtual host configuration, TLS certificates, and service URLs.
26+
'';
27+
};
28+
internal_port = mkOption {
29+
type = types.port;
30+
description = ''
31+
The local port the service listens on.
32+
'';
2333
};
24-
internal_port = mkOption { type = types.port; };
2534
useLocalDatabase = mkOption {
2635
type = types.bool;
2736
default = true;
37+
description = ''
38+
Whether to use a local database instance for this service.
39+
When enabled (default), the service will deploy and manage
40+
its own postgres database. When disabled, you must configure external
41+
database connection parameters separately.
42+
'';
2843
};
2944
smtp = {
3045
hostname = mkOption {
3146
type = types.nullOr types.str;
3247
default = null;
48+
example = "mail.secshell.net";
49+
description = ''
50+
SMTP server hostname for outgoing email.
51+
Leave null to disable email functionality.
52+
'';
3353
};
3454
from = mkOption {
3555
type = types.nullOr types.str;
3656
default = null;
57+
example = "[email protected]";
58+
description = ''
59+
The email address shown as the sender in outgoing emails.
60+
61+
Important: When this doesn't match the SMTP service account's email address,
62+
you must configure your mailserver to allow sending from this address (alias or sender rewriting)
63+
'';
3764
};
3865
port = mkOption {
3966
type = types.port;
4067
default = 587;
68+
example = 465;
69+
description = ''
70+
SMTP server port. STARTTLS uses 587, TLS uses 465 by default.
71+
'';
4172
};
4273
user = mkOption {
4374
type = types.nullOr types.str;
4475
default = null;
76+
description = ''
77+
SMTP authentication username.
78+
Typically the full email address of the service account which is being used to send mails..
79+
'';
4580
};
4681
noReplyAddress = mkOption {
4782
type = types.nullOr types.str;
4883
default = config.secshell.gitea.from;
4984
defaultText = "config.secshell.gitea.from";
85+
example = "[email protected]";
86+
description = ''
87+
"From" address for automated/non-reply emails.
88+
'';
5089
};
5190
};
5291
database = {
5392
hostname = mkOption {
5493
type = types.str;
5594
default = "";
95+
description = ''
96+
Database server hostname. Not required if local database is being used.
97+
'';
5698
};
5799
username = mkOption {
58100
type = types.str;
59101
default = "gitea";
102+
description = ''
103+
Database user account with read/write privileges.
104+
For PostgreSQL, ensure the user has CREATEDB permission
105+
for initial setup if creating databases automatically.
106+
'';
60107
};
61108
name = mkOption {
62109
type = types.str;
63110
default = "gitea";
111+
description = ''
112+
Name of the database to use.
113+
Will be created automatically if the user has permissions.
114+
'';
64115
};
65116
};
66117
appName = mkOption {
67118
type = types.str;
68119
default = "Secure Shell Networks: Gitea";
120+
description = ''
121+
The application name of the gitea instance.
122+
'';
69123
};
70124
sshPort = mkOption {
71125
type = types.port;
@@ -74,18 +128,33 @@ in
74128
requireSignInView = mkOption {
75129
type = types.bool;
76130
default = true;
131+
description = ''
132+
Enable this to force users to log in to view any page or to use API.
133+
It could be set to "expensive" to block anonymous users accessing some
134+
pages which consume a lot of resources, for example: block anonymous AI
135+
crawlers from accessing repo code pages. The "expensive" mode is experimental
136+
and subject to change.
137+
'';
77138
};
78139
enableNotifyMail = mkOption {
79140
type = types.bool;
80141
default = true;
142+
description = ''
143+
Enable this to send e-mail to watchers of a repository when something happens,
144+
like creating issues. Requires Mailer to be enabled.
145+
'';
81146
};
82147
allowOnlyExternalRegistrations = mkOption {
83148
type = types.bool;
84149
default = true;
150+
description = ''
151+
Set to true to force registration only using third-party services.
152+
'';
85153
};
86154
defaultKeepEmailPrivate = mkOption {
87155
type = types.bool;
88156
default = true;
157+
description = "By default set users to keep their email address private.";
89158
};
90159
};
91160

modules/graylog.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ in
2020
type = types.str;
2121
default = "graylog.${toString config.networking.fqdn}";
2222
defaultText = "graylog.\${toString config.networking.fqdn}";
23+
description = ''
24+
The primary domain name for this service.
25+
Used for virtual host configuration, TLS certificates, and service URLs.
26+
'';
27+
};
28+
internal_port = mkOption {
29+
type = types.port;
30+
description = "The local port the service listens on.";
2331
};
24-
internal_port = mkOption { type = types.port; };
2532
};
2633
config = mkIf cfg.enable {
2734
sops.secrets."graylog/rootPassword".owner = "graylog";

modules/hedgedoc.nix

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,76 @@ in
1717
type = types.str;
1818
default = "md.${toString config.networking.fqdn}";
1919
defaultText = "md.\${toString config.networking.fqdn}";
20+
description = ''
21+
The primary domain name for this service.
22+
Used for virtual host configuration, TLS certificates, and service URLs.
23+
'';
24+
};
25+
internal_port = mkOption {
26+
type = types.port;
27+
description = ''
28+
The local port the service listens on.
29+
'';
2030
};
21-
internal_port = mkOption { type = types.port; };
2231
useLocalDatabase = mkOption {
2332
type = types.bool;
2433
default = true;
34+
description = ''
35+
Whether to use a local database instance for this service.
36+
When enabled (default), the service will deploy and manage
37+
its own postgres database. When disabled, you must configure external
38+
database connection parameters separately.
39+
'';
2540
};
2641
database = {
2742
hostname = mkOption {
2843
type = types.str;
2944
default = "/run/postgresql";
45+
description = ''
46+
Database server hostname. Not required if local database is being used.
47+
'';
3048
};
3149
username = mkOption {
3250
type = types.str;
3351
default = "hedgedoc";
52+
description = ''
53+
Database user account with read/write privileges.
54+
For PostgreSQL, ensure the user has CREATEDB permission
55+
for initial setup if creating databases automatically.
56+
'';
3457
};
3558
name = mkOption {
3659
type = types.str;
3760
default = "hedgedoc";
61+
description = ''
62+
Name of the database to use.
63+
Will be created automatically if the user has permissions.
64+
'';
3865
};
3966
};
4067
oidc = {
4168
domain = mkOption {
4269
type = types.str;
4370
default = "";
71+
description = ''
72+
The open id connect server used for authentication.
73+
Leave null to disable oidc authentication.
74+
'';
4475
};
4576
realm = mkOption {
4677
type = types.str;
4778
default = "main";
79+
description = ''
80+
The realm to use for the open id connect authentication.
81+
'';
4882
};
4983
clientId = mkOption {
5084
type = types.str;
5185
default = cfg.domain;
5286
defaultText = "config.secshell.hedgedoc.domain";
87+
description = ''
88+
The client id for the open id connect authentication.
89+
'';
5390
};
5491
};
5592
};

0 commit comments

Comments
 (0)