liquid: remove unused features

- `hexStr` is unused
- Simplify ExecStart options
- Quote `dataDir`
- Remove unneeded `pidFile` setting
This commit is contained in:
Erik Arvstedt 2021-10-01 11:51:59 +02:00
parent 82d910e937
commit 09169365d8
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -143,7 +143,6 @@ let
bitcoind = config.services.bitcoind;
pidFile = "${cfg.dataDir}/liquidd.pid";
configFile = pkgs.writeText "elements.conf" ''
chain=${bitcoind.makeNetworkName "liquidv1" ''
regtest
@ -176,11 +175,6 @@ let
# Extra config options (from liquidd nixos service)
${cfg.extraConfig}
'';
cmdlineOptions = concatMapStringsSep " " (arg: "'${arg}'") [
"-datadir=${cfg.dataDir}"
"-pid=${pidFile}"
];
hexStr = types.strMatching "[0-9a-f]+";
rpcUserOpts = { name, ... }: {
options = {
name = mkOption {
@ -234,8 +228,7 @@ in {
Type = "simple";
User = cfg.user;
Group = cfg.group;
ExecStart = "${nbPkgs.elementsd}/bin/elementsd ${cmdlineOptions}";
PIDFile = pidFile;
ExecStart = "${nbPkgs.elementsd}/bin/elementsd -datadir='${cfg.dataDir}'";
Restart = "on-failure";
ReadWritePaths = cfg.dataDir;
} // nbLib.allowedIPAddresses cfg.enforceTor;