Skip to content

Commit 13d5456

Browse files
committed
Use the same idea as prysm-beacon to set the user.
1 parent 4271d7a commit 13d5456

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

modules/geth/default.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ in {
122122
serviceConfig = mkMerge [
123123
baseServiceConfig
124124
{
125-
User = mkDefault serviceName;
125+
User =
126+
if cfg.user != null
127+
then cfg.user
128+
else mkDefault serviceName;
126129
StateDirectory = mkDefault serviceName;
127130
ExecStart = mkDefault "${cfg.package}/bin/geth ${scriptArgs}";
128131
}

modules/geth/options.nix

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

12+
user = mkOption {
13+
type = types.nullOr types.str;
14+
default = null;
15+
description = "User to run the service as.";
16+
};
17+
1218
inherit args;
1319

1420
extraArgs = mkOption {

0 commit comments

Comments
 (0)