Skip to content

Commit ea35bff

Browse files
MartinNikovPetarKirov
authored andcommitted
config(modules/geth): Add ipcEnable option
1 parent 7fe252f commit ea35bff

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

modules/geth/args.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,10 @@ with lib; {
179179
default = null;
180180
description = mdDoc "Data directory for Geth. Defaults to '%S/geth-\<name\>', which generally resolves to /var/lib/geth-\<name\>.";
181181
};
182+
183+
ipcEnable = mkOption {
184+
type = types.bool;
185+
default = false;
186+
description = mdDoc "Enable the IPC-RPC server";
187+
};
182188
}

modules/geth/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ in {
8181
};
8282

8383
# filter out certain args which need to be treated differently
84-
specialArgs = ["--network" "--authrpc.jwtsecret"];
84+
specialArgs = ["--network" "--authrpc.jwtsecret" "--ipcEnable"];
8585
isNormalArg = name: (findFirst (arg: hasPrefix arg name) null specialArgs) == null;
8686

8787
filteredArgs = builtins.filter isNormalArg args;
@@ -96,13 +96,18 @@ in {
9696
then "--authrpc.jwtsecret %d/jwtsecret"
9797
else "";
9898

99+
ipc =
100+
if cfg.args.ipcEnable
101+
then ""
102+
else "--ipcdisable";
103+
99104
datadir =
100105
if cfg.args.datadir != null
101106
then "--datadir ${cfg.args.datadir}"
102107
else "--datadir %S/${serviceName}";
103108
in ''
109+
${ipc} ${network} ${jwtSecret} \
104110
${datadir} \
105-
--ipcdisable ${network} ${jwtSecret} \
106111
${concatStringsSep " \\\n" filteredArgs} \
107112
${lib.escapeShellArgs cfg.extraArgs}
108113
'';

0 commit comments

Comments
 (0)