From 09e0042aa84b5effa746d9cf76fd06b3a97ad06c Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jan 2021 13:24:08 +0100 Subject: [PATCH] spark-wallet: add consistent address options --- modules/netns-isolation.nix | 2 +- modules/spark-wallet.nix | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index e417fcc..36e5300 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -274,7 +274,7 @@ in { services.electrs.address = netns.electrs.address; services.spark-wallet = { - host = netns.spark-wallet.address; + address = netns.spark-wallet.address; extraArgs = "--no-tls"; }; diff --git a/modules/spark-wallet.nix b/modules/spark-wallet.nix index 6f9ca68..091fb23 100644 --- a/modules/spark-wallet.nix +++ b/modules/spark-wallet.nix @@ -16,7 +16,7 @@ let ''} exec ${config.nix-bitcoin.pkgs.spark-wallet}/bin/spark-wallet \ --ln-path '${config.services.clightning.networkDir}' \ - --host ${cfg.host} \ + --host ${cfg.address} --port ${toString cfg.port} \ --config '${config.nix-bitcoin.secretsDir}/spark-wallet-login' \ ${optionalString cfg.enforceTor torRateProvider} \ $publicURL \ @@ -31,10 +31,15 @@ in { If enabled, the spark-wallet service will be installed. ''; }; - host = mkOption { + address = mkOption { type = types.str; default = "localhost"; - description = "http(s) server listen address."; + description = "http(s) server address."; + }; + port = mkOption { + type = types.port; + default = 9737; + description = "http(s) server port."; }; onion-service = mkOption { type = types.bool; @@ -63,7 +68,7 @@ in { services.tor.hiddenServices.spark-wallet = mkIf cfg.onion-service { map = [{ - port = 80; toPort = 9737; toHost = cfg.host; + port = 80; toPort = cfg.port; toHost = cfg.address; }]; version = 3; };