diff --git a/flake.lock b/flake.lock index 945a198..25f8436 100644 --- a/flake.lock +++ b/flake.lock @@ -33,16 +33,16 @@ }, "nixpkgsUnstable": { "locked": { - "lastModified": 1633514490, - "narHash": "sha256-wQrUBgyF4EXlz9HgEHrQEj9vbgh6+nO8iXc3XCTQkLA=", + "lastModified": 1635295995, + "narHash": "sha256-sGYiXjFlxTTMNb4NSkgvX+knOOTipE6gqwPUQpxNF+c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1c1b567985bd1be77601657562ed20299d169529", + "rev": "22a500a3f87bbce73bd8d777ef920b43a636f018", "type": "github" }, "original": { "owner": "NixOS", - "ref": "master", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 65ef974..302b612 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; - nixpkgsUnstable.url = "github:NixOS/nixpkgs/master"; + nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; diff --git a/modules/liquid.nix b/modules/liquid.nix index a0714e9..86ac93f 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -15,6 +15,16 @@ let default = 7042; description = "Override the default port on which to listen for connections."; }; + onionPort = mkOption { + type = types.nullOr types.port; + # When the liquidd onion service is enabled, add an onion-tagged socket + # to distinguish local connections from Tor connections + default = if (config.nix-bitcoin.onionServices.liquidd.enable or false) then 7043 else null; + description = '' + Port to listen for Tor peer connections. + If set, inbound connections to this port are tagged as onion peers. + ''; + }; extraConfig = mkOption { type = types.lines; default = ""; @@ -153,8 +163,10 @@ let ${optionalString (cfg.validatepegin != null) "validatepegin=${if cfg.validatepegin then "1" else "0"}"} # Connection options - ${optionalString cfg.listen "bind=${cfg.address}"} - port=${toString cfg.port} + ${optionalString cfg.listen + "bind=${cfg.address}:${toString cfg.port}"} + ${optionalString (cfg.listen && cfg.onionPort != null) + "bind=${cfg.address}:${toString cfg.onionPort}=onion"} ${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"} listen=${if cfg.listen then "1" else "0"} diff --git a/test/tests.nix b/test/tests.nix index 6e0710f..5ac16fc 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -74,8 +74,6 @@ let tests.charge-lnd = cfg.charge-lnd.enable; tests.electrs = cfg.electrs.enable; - # Sigterm is broken during IBD in version 0.9.0 https://github.com/romanz/electrs/issues/532 - systemd.services.electrs.serviceConfig.KillSignal = "SIGKILL"; tests.liquidd = cfg.liquidd.enable; services.liquidd.extraConfig = mkIf config.test.noConnections "connect=0";