Merge pull request #2604 from wkennington/master.notbit
notbit: Bump version and add more configuration options
This commit is contained in:
commit
a0c6f07be4
@ -1,5 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.notbit;
|
cfg = config.services.notbit;
|
||||||
varDir = "/var/lib/notbit";
|
varDir = "/var/lib/notbit";
|
||||||
@ -14,6 +15,10 @@ let
|
|||||||
--set XDG_RUNTIME_DIR ${varDir}
|
--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
|
in
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
@ -35,7 +40,7 @@ with lib;
|
|||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.uniq types.int;
|
type = types.uniq types.int;
|
||||||
default = 8443;
|
default = 8444;
|
||||||
description = "The port which the daemon listens for other bitmessage clients";
|
description = "The port which the daemon listens for other bitmessage clients";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,6 +50,38 @@ with lib;
|
|||||||
description = "Set the nice level for the notbit daemon";
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -53,7 +90,7 @@ with lib;
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.notbit sendmail ];
|
environment.systemPackages = [ sendmail ];
|
||||||
|
|
||||||
systemd.services.notbit = {
|
systemd.services.notbit = {
|
||||||
description = "Notbit daemon";
|
description = "Notbit daemon";
|
||||||
@ -70,7 +107,7 @@ with lib;
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
ExecStart = "${pkgs.notbit}/bin/notbit -d -p ${toString cfg.port}";
|
ExecStart = "${pkgs.notbit}/bin/notbit -d ${listen} ${peers} ${opts}";
|
||||||
User = "notbit";
|
User = "notbit";
|
||||||
Group = "notbit";
|
Group = "notbit";
|
||||||
UMask = "0077";
|
UMask = "0077";
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{ stdenv, fetchgit, autoconf, automake, pkgconfig, openssl }:
|
{ stdenv, fetchgit, autoconf, automake, pkgconfig, openssl }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "notbit-0.2-28-g06f9160";
|
name = "notbit-git-faf0930";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "git://git.busydoingnothing.co.uk/notbit";
|
url = "git://github.com/bpeel/notbit";
|
||||||
rev = "06f916081836de12f8e57a9f50c95d4d1b51627f";
|
rev = "faf09304bf723e75f3d98cca93cf45236ee9d6b6";
|
||||||
sha256 = "d5c38eea1d9ca213bfbea5c88350478a5088b5532e939de9680d72e60aa65288";
|
sha256 = "b229f87c4c5e901bfd8b13dffe31157126d98ed02118fff6553e8b58eb9ed030";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ autoconf automake pkgconfig openssl ];
|
buildInputs = [ autoconf automake pkgconfig openssl ];
|
||||||
|
Loading…
Reference in New Issue
Block a user