Skip to content

Commit 107c647

Browse files
committed
Add new dynamicUser option to disable DynamicUser.
Default is true which leaves dynamicUser enabled, and when set to false the systemd service DynamicUser option is disabled but all of the other options which are automatically enabled by that option are set to default enabled.
1 parent a1db5da commit 107c647

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

modules/geth/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ in {
133133
(mkIf (cfg.args.authrpc.jwtsecret != null) {
134134
LoadCredential = ["jwtsecret:${cfg.args.authrpc.jwtsecret}"];
135135
})
136-
(mkIf (cfg.user != null) {
136+
(mkIf (!cfg.dynamicUser) {
137137
DynamicUser = mkForce false;
138138
RemoveIPC = mkDefault true;
139139
PrivateTmp = mkDefault true;

modules/geth/options.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
options = rec {
1010
enable = mkEnableOption "Go Ethereum Node";
1111

12+
inherit args;
13+
14+
dynamicUser = mkOption {
15+
type = types.bool;
16+
default = true;
17+
description = "Whether to use systemd's DynamicUser feature.";
18+
};
19+
1220
user = mkOption {
1321
type = types.nullOr types.str;
1422
default = null;
1523
description = "User to run the service as.";
1624
};
1725

18-
inherit args;
19-
2026
extraArgs = mkOption {
2127
type = types.listOf types.str;
2228
description = "Additional arguments to pass to Go Ethereum.";

0 commit comments

Comments
 (0)