mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-28 16:10:17 +02:00
GNUnet: Add options; add as a system package; provide /etc/gnunetd.conf.
svn path=/nixos/trunk/; revision=19630
This commit is contained in:
parent
cb728f833f
commit
06aeb7d87f
|
@ -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";
|
||||||
|
|
||||||
|
@ -205,10 +240,10 @@ 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}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue