GNUnet: Add options; add as a system package; provide /etc/gnunetd.conf.

svn path=/nixos/trunk/; revision=19630
This commit is contained in:
Ludovic Courtès 2010-01-23 15:47:33 +00:00
parent cb728f833f
commit 06aeb7d87f

View file

@ -12,21 +12,27 @@ let
GNUNETD_HOME = ${home} GNUNETD_HOME = ${home}
[GNUNETD] [GNUNETD]
HOSTLISTURL = ${lib.concatStringsSep " " hostLists} HOSTLISTURL = ${concatStringsSep " " hostLists}
APPLICATIONS = ${lib.concatStringsSep " " applications} APPLICATIONS = ${concatStringsSep " " applications}
TRANSPORTS = ${lib.concatStringsSep " " transports} TRANSPORTS = ${concatStringsSep " " transports}
[LOAD] [LOAD]
MAXNETDOWNBPSTOTAL = ${toString load.maxNetDownBandwidth} MAXNETDOWNBPSTOTAL = ${toString load.maxNetDownBandwidth}
MAXNETUPBPSTOTAL = ${toString load.maxNetUpBandwidth} MAXNETUPBPSTOTAL = ${toString load.maxNetUpBandwidth}
HARDUPLIMIT = ${toString load.hardNetUpBandwidth} HARDUPLIMIT = ${toString load.hardNetUpBandwidth}
MAXCPULOAD = ${toString load.maxCPULoad} MAXCPULOAD = ${toString load.maxCPULoad}
INTERFACES = ${lib.concatStringsSep " " load.interfaces} INTERFACES = ${concatStringsSep " " load.interfaces}
[FS] [FS]
QUOTA = ${toString fileSharing.quota} QUOTA = ${toString fileSharing.quota}
ACTIVEMIGRATION = ${if fileSharing.activeMigration then "YES" else "NO"} ACTIVEMIGRATION = ${if fileSharing.activeMigration then "YES" else "NO"}
[UDP]
PORT = ${toString udp.port}
[TCP]
PORT = ${toString tcp.port}
[MODULES] [MODULES]
sqstore = sqstore_sqlite sqstore = sqstore_sqlite
dstore = dstore_sqlite dstore = dstore_sqlite
@ -122,6 +128,24 @@ in
}; };
}; };
udp = {
port = mkOption {
default = 2086; # assigned by IANA
description = ''
The UDP port for use by GNUnet.
'';
};
};
tcp = {
port = mkOption {
default = 2086; # assigned by IANA
description = ''
The TCP port for use by GNUnet.
'';
};
};
load = { load = {
maxNetDownBandwidth = mkOption { maxNetDownBandwidth = mkOption {
default = 50000; default = 50000;
@ -191,6 +215,17 @@ in
home = "/var/empty"; home = "/var/empty";
}; };
# The user tools that talk to `gnunetd' should come from the same source,
# so install them globally.
environment.systemPackages = [ pkgs.gnunet ];
environment.etc = [
# Tools such as `gnunet-transport-check' expect /etc/gnunetd.conf.
{ source = configFile;
target = "gnunetd.conf";
}
];
jobs.gnunetd = jobs.gnunetd =
{ description = "The GNUnet Daemon"; { description = "The GNUnet Daemon";
@ -206,7 +241,7 @@ in
exec = exec =
'' ''
${pkgs.gnunet}/bin/gnunetd \ ${pkgs.gnunet}/bin/gnunetd \
${if debug then "--debug" else "" } \ ${if cfg.debug then "--debug" else "" } \
--user="gnunetd" \ --user="gnunetd" \
--config="${configFile}" \ --config="${configFile}" \
--log="${cfg.logLevel}" --log="${cfg.logLevel}"