From 8915390baba34222e61af7e9172dd141fa8f653a Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 13 May 2014 20:19:27 -0500 Subject: notbit: Use the correct default port --- nixos/modules/services/networking/notbit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/notbit.nix b/nixos/modules/services/networking/notbit.nix index b97435042395..63a332893461 100644 --- a/nixos/modules/services/networking/notbit.nix +++ b/nixos/modules/services/networking/notbit.nix @@ -35,7 +35,7 @@ with lib; port = mkOption { type = types.uniq types.int; - default = 8443; + default = 8444; description = "The port which the daemon listens for other bitmessage clients"; }; -- cgit 1.4.1 From 042273e528b5e5837984f56f435053b8c5382770 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 13 May 2014 20:19:57 -0500 Subject: notbit: Don't include unecessary notbit binaries in the environment --- nixos/modules/services/networking/notbit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/notbit.nix b/nixos/modules/services/networking/notbit.nix index 63a332893461..b6a2b7897caa 100644 --- a/nixos/modules/services/networking/notbit.nix +++ b/nixos/modules/services/networking/notbit.nix @@ -53,7 +53,7 @@ with lib; config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.notbit sendmail ]; + environment.systemPackages = [ sendmail ]; systemd.services.notbit = { description = "Notbit daemon"; -- cgit 1.4.1 From 08467c14deffcf33e0a1861c2dd50f7ebfd98852 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 13 May 2014 20:20:19 -0500 Subject: notbit: Add additional options to the daemon --- nixos/modules/services/networking/notbit.nix | 39 +++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/notbit.nix b/nixos/modules/services/networking/notbit.nix index b6a2b7897caa..3e8c956f191e 100644 --- a/nixos/modules/services/networking/notbit.nix +++ b/nixos/modules/services/networking/notbit.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, ... }: +with pkgs.lib; let cfg = config.services.notbit; varDir = "/var/lib/notbit"; @@ -14,6 +15,10 @@ let --set XDG_RUNTIME_DIR ${varDir} ''; }; + opts = "${optionalString cfg.allowPrivateAddresses "-L"} ${optionalString cfg.noBootstrap "-b"} ${optionalString cfg.specifiedPeersOnly "-e"}"; + peers = concatStringsSep " " (map (str: "-P \"${str}\"") cfg.peers); + listen = if cfg.listenAddress == [] then "-p ${toString cfg.port}" else + concatStringsSep " " (map (addr: "-a \"${addr}:${toString cfg.port}\"") cfg.listenAddress); in with lib; @@ -45,6 +50,38 @@ with lib; description = "Set the nice level for the notbit daemon"; }; + listenAddress = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "localhost" "myhostname" ]; + description = "The addresses which notbit will use to listen for incoming connections. These addresses are advertised to connecting clients."; + }; + + peers = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "bitmessage.org:8877" ]; + description = "The initial set of peers notbit will connect to."; + }; + + specifiedPeersOnly = mkOption { + type = types.uniq types.bool; + default = false; + description = "If true, notbit will only connect to peers specified by the peers option."; + }; + + allowPrivateAddresses = mkOption { + type = types.uniq types.bool; + default = false; + description = "If true, notbit will allow connections to to RFC 1918 addresses."; + }; + + noBootstrap = mkOption { + type = types.uniq types.bool; + default = false; + description = "If true, notbit will not bootstrap an initial peerlist from bitmessage.org servers"; + }; + }; }; @@ -70,7 +107,7 @@ with lib; serviceConfig = { Type = "forking"; - ExecStart = "${pkgs.notbit}/bin/notbit -d -p ${toString cfg.port}"; + ExecStart = "${pkgs.notbit}/bin/notbit -d ${listen} ${peers} ${opts}"; User = "notbit"; Group = "notbit"; UMask = "0077"; -- cgit 1.4.1