From 32e70a7516a0d9602b6884c0281abc59a85d3228 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 21 Aug 2020 22:36:02 +0200 Subject: [PATCH] netns: move webindex config for modules-only usage webindex is only available in secure-node. --- modules/netns-isolation.nix | 8 ++++++-- modules/nix-bitcoin-webindex.nix | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 83230ed..e54550c 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -83,6 +83,12 @@ in { The user's group is also authorized. ''; }; + + netns = mkOption { + default = netns; + readOnly = true; + description = "Exposes netns parameters."; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -286,8 +292,6 @@ in { host = netns.nanopos.address; }; - services.nix-bitcoin-webindex.host = netns.nginx.address; - services.lightning-loop.cliExec = mkCliExec "lightning-loop"; } ]); diff --git a/modules/nix-bitcoin-webindex.nix b/modules/nix-bitcoin-webindex.nix index 7375f6e..8982f6c 100644 --- a/modules/nix-bitcoin-webindex.nix +++ b/modules/nix-bitcoin-webindex.nix @@ -41,7 +41,10 @@ in { }; host = mkOption { type = types.str; - default = "localhost"; + default = if config.nix-bitcoin.netns-isolation.enable then + config.nix-bitcoin.netns-isolation.netns.nginx.address + else + "localhost"; description = "HTTP server listen address."; }; enforceTor = nix-bitcoin-services.enforceTor;