Skip to content

Commit d57abc6

Browse files
committed
module: make all flags nullable
1 parent 5961115 commit d57abc6

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

modules/step-agent.nix

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ in
1414
# TODO: make user / group configurable
1515
settings = {
1616
config = lib.mkOption {
17-
type = lib.types.str;
18-
default = "/etc/step-agent/agent.yaml";
17+
type = lib.types.nullOr lib.types.str;
18+
default = null;
1919
description = "The configuration file to use";
2020
};
2121

@@ -122,14 +122,14 @@ in
122122
};
123123

124124
apiUrl = lib.mkOption {
125-
type = lib.types.str;
126-
default = "https://gateway.smallstep.com";
125+
type = lib.types.nullOr lib.types.str;
126+
default = null;
127127
description = "The url where the Smallstep API can be found";
128128
};
129129

130130
attestationCaUrl = lib.mkOption {
131-
type = lib.types.str;
132-
default = "https://att.smallstep.com/1.0";
131+
type = lib.types.nullOr lib.types.str;
132+
default = null;
133133
description = "The url for the Smallstep Attestation CA";
134134
};
135135

@@ -176,8 +176,8 @@ in
176176
};
177177

178178
agentPath = lib.mkOption {
179-
type = lib.types.str;
180-
default = "/run/step-agent";
179+
type = lib.types.nullOr lib.types.str;
180+
default = null;
181181
description = "The path to the directory to write the service certificates";
182182
};
183183

@@ -188,8 +188,8 @@ in
188188
};
189189

190190
ipc = lib.mkOption {
191-
type = lib.types.str;
192-
default = "@step-agent-ipc";
191+
type = lib.types.nullOr lib.types.str;
192+
default = null;
193193
description = "The path to the UNIX socket the IPC service binds on. May be prefixed with an '@' to denote an abstract socket";
194194
};
195195

@@ -224,20 +224,20 @@ in
224224
};
225225

226226
loginDomain = lib.mkOption {
227-
type = lib.types.str;
228-
default = "smallstep.com";
227+
type = lib.types.nullOr lib.types.str;
228+
default = null;
229229
description = "Specify the login domain";
230230
};
231231

232232
pkcs11 = lib.mkOption {
233-
type = lib.types.str;
234-
default = "/run/step-agent/step-agent-pkcs11.sock";
233+
type = lib.types.nullOr lib.types.str;
234+
default = null;
235235
description = "The path to the UNIX socket the PKCS11 server binds on";
236236
};
237237

238238
sshAgent = lib.mkOption {
239-
type = lib.types.str;
240-
default = "/run/step-agent/step-agent-ssh.sock";
239+
type = lib.types.nullOr lib.types.str;
240+
default = null;
241241
description = "The path to the UNIX socket the ssh-agent service binds on";
242242
};
243243

@@ -248,19 +248,21 @@ in
248248
};
249249

250250
logDir = lib.mkOption {
251-
type = lib.types.str;
252-
default = "/var/log/step-agent";
251+
type = lib.types.nullOr lib.types.str;
252+
default = null;
253253
description = "Directory path for storing agent logs";
254254
};
255255

256256
logLevel = lib.mkOption {
257-
type = lib.types.enum [
258-
"debug"
259-
"info"
260-
"warn"
261-
"error"
262-
];
263-
default = "info";
257+
type = lib.types.nullOr (
258+
lib.types.enum [
259+
"debug"
260+
"info"
261+
"warn"
262+
"error"
263+
]
264+
);
265+
default = null;
264266
description = "Log level: debug, info, warn or error";
265267
};
266268

@@ -317,7 +319,7 @@ in
317319
StateDirectory = "step-agent";
318320
Type = "notify";
319321
WatchdogSec = "60s";
320-
ProtectSystem = "strict";
322+
ProtectSystem = "yes"; # what stops us from using strict
321323
ProtectHome = "read-only";
322324
PrivateTmp = true;
323325
SecureBits = "keep-caps";

0 commit comments

Comments
 (0)