Putting the gnunet module up to date. It still doesn't start gnunet though.
No idea why.
This commit is contained in:
parent
b4af56d376
commit
f50014339a
@ -44,7 +44,6 @@ in
|
|||||||
postfix = 14;
|
postfix = 14;
|
||||||
dovecot = 15;
|
dovecot = 15;
|
||||||
tomcat = 16;
|
tomcat = 16;
|
||||||
gnunetd = 17;
|
|
||||||
pulseaudio = 22; # must match `pulseaudio' GID
|
pulseaudio = 22; # must match `pulseaudio' GID
|
||||||
gpsd = 23;
|
gpsd = 23;
|
||||||
polkituser = 28;
|
polkituser = 28;
|
||||||
|
@ -6,37 +6,27 @@ let
|
|||||||
|
|
||||||
cfg = config.services.gnunet;
|
cfg = config.services.gnunet;
|
||||||
|
|
||||||
|
homeDir = "/var/lib/gnunet";
|
||||||
|
|
||||||
configFile = with cfg; pkgs.writeText "gnunetd.conf"
|
configFile = with cfg; pkgs.writeText "gnunetd.conf"
|
||||||
''
|
''
|
||||||
[PATHS]
|
[PATHS]
|
||||||
GNUNETD_HOME = ${home}
|
SERVICEHOME = ${homeDir}
|
||||||
|
|
||||||
[GNUNETD]
|
[ats]
|
||||||
HOSTLISTURL = ${concatStringsSep " " hostLists}
|
WAN_QUOTA_IN = ${toString load.maxNetDownBandwidth} b
|
||||||
APPLICATIONS = ${concatStringsSep " " applications}
|
WAN_QUOTA_OUT = ${toString load.maxNetUpBandwidth} b
|
||||||
TRANSPORTS = ${concatStringsSep " " transports}
|
|
||||||
|
|
||||||
[LOAD]
|
[datastore]
|
||||||
MAXNETDOWNBPSTOTAL = ${toString load.maxNetDownBandwidth}
|
QUOTA = ${toString fileSharing.quota} MB
|
||||||
MAXNETUPBPSTOTAL = ${toString load.maxNetUpBandwidth}
|
|
||||||
HARDUPLIMIT = ${toString load.hardNetUpBandwidth}
|
|
||||||
MAXCPULOAD = ${toString load.maxCPULoad}
|
|
||||||
INTERFACES = ${concatStringsSep " " load.interfaces}
|
|
||||||
|
|
||||||
[FS]
|
[transport-udp]
|
||||||
QUOTA = ${toString fileSharing.quota}
|
|
||||||
ACTIVEMIGRATION = ${if fileSharing.activeMigration then "YES" else "NO"}
|
|
||||||
|
|
||||||
[UDP]
|
|
||||||
PORT = ${toString udp.port}
|
PORT = ${toString udp.port}
|
||||||
|
ADVERTISED_PORT = ${toString udp.port}
|
||||||
|
|
||||||
[TCP]
|
[transport-tcp]
|
||||||
PORT = ${toString tcp.port}
|
PORT = ${toString tcp.port}
|
||||||
|
ADVERTISED_PORT = ${toString tcp.port}
|
||||||
[MODULES]
|
|
||||||
sqstore = sqstore_sqlite
|
|
||||||
dstore = dstore_sqlite
|
|
||||||
topology = topology_default
|
|
||||||
|
|
||||||
${extraOptions}
|
${extraOptions}
|
||||||
'';
|
'';
|
||||||
@ -59,58 +49,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
home = mkOption {
|
|
||||||
default = "/var/lib/gnunet";
|
|
||||||
description = ''
|
|
||||||
Directory where the GNUnet daemon will store its data.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
debug = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
When true, run in debug mode; gnunetd will not daemonize and
|
|
||||||
error messages will be written to stderr instead of a
|
|
||||||
logfile.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
logLevel = mkOption {
|
|
||||||
default = "ERROR";
|
|
||||||
example = "INFO";
|
|
||||||
description = ''
|
|
||||||
Log level of the deamon (see `gnunetd(1)' for details).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
hostLists = mkOption {
|
|
||||||
default = [
|
|
||||||
"http://gnunet.org/hostlist.php"
|
|
||||||
"http://gnunet.mine.nu:8081/hostlist"
|
|
||||||
"http://vserver1236.vserver-on.de/hostlist-074"
|
|
||||||
];
|
|
||||||
description = ''
|
|
||||||
URLs of host lists.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
applications = mkOption {
|
|
||||||
default = [ "advertising" "getoption" "fs" "stats" "traffic" ];
|
|
||||||
example = [ "chat" "fs" ];
|
|
||||||
description = ''
|
|
||||||
List of GNUnet applications supported by the daemon. Note that
|
|
||||||
`fs', which means "file sharing", is probably the one you want.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
transports = mkOption {
|
|
||||||
default = [ "udp" "tcp" "http" "nat" ];
|
|
||||||
example = [ "smtp" "http" ];
|
|
||||||
description = ''
|
|
||||||
List of transport methods used by the server.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSharing = {
|
fileSharing = {
|
||||||
quota = mkOption {
|
quota = mkOption {
|
||||||
default = 1024;
|
default = 1024;
|
||||||
@ -118,14 +56,6 @@ in
|
|||||||
Maximum file system usage (in MiB) for file sharing.
|
Maximum file system usage (in MiB) for file sharing.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
activeMigration = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to allow active migration of content originating
|
|
||||||
from other nodes.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
udp = {
|
udp = {
|
||||||
@ -170,33 +100,13 @@ in
|
|||||||
data.
|
data.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
maxCPULoad = mkOption {
|
|
||||||
default = 100;
|
|
||||||
description = ''
|
|
||||||
Maximum CPU load (percentage) authorized for the GNUnet
|
|
||||||
daemon.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
interfaces = mkOption {
|
|
||||||
default = [ "eth0" ];
|
|
||||||
example = [ "wlan0" "eth1" ];
|
|
||||||
description = ''
|
|
||||||
List of network interfaces to use.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = mkOption {
|
extraOptions = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = ''
|
|
||||||
[NETWORK]
|
|
||||||
INTERFACE = eth3
|
|
||||||
'';
|
|
||||||
description = ''
|
description = ''
|
||||||
Additional options that will be copied verbatim in `gnunetd.conf'.
|
Additional options that will be copied verbatim in `gnunet.conf'.
|
||||||
See `gnunetd.conf(5)' for details.
|
See `gnunet.conf(5)' for details.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -209,44 +119,28 @@ in
|
|||||||
config = mkIf config.services.gnunet.enable {
|
config = mkIf config.services.gnunet.enable {
|
||||||
|
|
||||||
users.extraUsers = singleton
|
users.extraUsers = singleton
|
||||||
{ name = "gnunetd";
|
{ name = "gnunet";
|
||||||
uid = config.ids.uids.gnunetd;
|
group = "gnunet";
|
||||||
description = "GNUnet Daemon User";
|
description = "GNUnet User";
|
||||||
home = "/var/empty";
|
home = homeDir;
|
||||||
|
createHome = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# The user tools that talk to `gnunetd' should come from the same source,
|
# The user tools that talk to `gnunetd' should come from the same source,
|
||||||
# so install them globally.
|
# so install them globally.
|
||||||
environment.systemPackages = [ pkgs.gnunet ];
|
environment.systemPackages = [ pkgs.gnunet ];
|
||||||
|
|
||||||
environment.etc = [
|
systemd.services.gnunet = {
|
||||||
# Tools such as `gnunet-transport-check' expect /etc/gnunetd.conf.
|
description = "GNUnet";
|
||||||
{ source = configFile;
|
after = [ "network.target" ];
|
||||||
target = "gnunetd.conf";
|
wantedBy = [ "multi-user.target" ];
|
||||||
}
|
serviceConfig.ExecStart = "${pkgs.gnunet}/bin/gnunet-arm -L DEBUG -l logfile -s -c ${configFile}";
|
||||||
];
|
serviceConfig.Type = "simple";
|
||||||
|
serviceConfig.User = "gnunet";
|
||||||
jobs.gnunetd =
|
serviceConfig.UMask = "0007";
|
||||||
{ description = "The GNUnet Daemon";
|
serviceConfig.WorkingDirectory = homeDir;
|
||||||
|
path = [ pkgs.gnunet ];
|
||||||
startOn = "started network-interfaces";
|
};
|
||||||
stopOn = "stopping network-interfaces";
|
|
||||||
|
|
||||||
preStart =
|
|
||||||
''
|
|
||||||
test -d "${cfg.home}" || \
|
|
||||||
( mkdir -m 755 -p "${cfg.home}" && chown -R gnunetd:users "${cfg.home}")
|
|
||||||
'';
|
|
||||||
|
|
||||||
exec =
|
|
||||||
''
|
|
||||||
${pkgs.gnunet}/bin/gnunetd \
|
|
||||||
${if cfg.debug then "--debug" else "" } \
|
|
||||||
--user="gnunetd" \
|
|
||||||
--config="${configFile}" \
|
|
||||||
--log="${cfg.logLevel}"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user