ipfs: workaround for upstream bug; doc fixes

This commit is contained in:
Eric Litak 2017-09-06 15:40:42 -07:00
parent 700b0945b1
commit 6324317c76

View File

@ -37,6 +37,7 @@ let
baseService = recursiveUpdate commonEnv { baseService = recursiveUpdate commonEnv {
wants = [ "ipfs-init.service" ]; wants = [ "ipfs-init.service" ];
preStart = '' preStart = ''
ipfs repo fsck # workaround for BUG #4212 (https://github.com/ipfs/go-ipfs/issues/4214)
ipfs --local config Addresses.API ${cfg.apiAddress} ipfs --local config Addresses.API ${cfg.apiAddress}
ipfs --local config Addresses.Gateway ${cfg.gatewayAddress} ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
'' + optionalString false/*cfg.autoMount*/ '' '' + optionalString false/*cfg.autoMount*/ ''
@ -91,17 +92,15 @@ in {
}; };
defaultMode = mkOption { defaultMode = mkOption {
description = "systemd service that is enabled by default";
type = types.enum [ "online" "offline" "norouting" ]; type = types.enum [ "online" "offline" "norouting" ];
default = "online"; default = "online";
description = "systemd service that is enabled by default";
}; };
autoMigrate = mkOption { autoMigrate = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = "Whether IPFS should try to migrate the file system automatically";
Whether IPFS should try to migrate the file system automatically.
'';
}; };
#autoMount = mkOption { #autoMount = mkOption {
@ -137,26 +136,22 @@ in {
enableGC = mkOption { enableGC = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = "Whether to enable automatic garbage collection";
Whether to enable automatic garbage collection.
'';
}; };
emptyRepo = mkOption { emptyRepo = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = "If set to true, the repo won't be initialized with help files";
If set to true, the repo won't be initialized with help files
'';
}; };
extraConfig = mkOption { extraConfig = mkOption {
type = types.attrs; type = types.attrs;
description = toString [ description = ''
"Attrset of daemon configuration to set using `ipfs config`, every time the daemon starts." Attrset of daemon configuration to set using <command>ipfs config</command>, every time the daemon starts.
"These are applied last, so may override configuration set by other options in this module." These are applied last, so may override configuration set by other options in this module.
"Keep in mind that this configuration is stateful; i.e., unsetting anything in here does not reset the value to the default!" Keep in mind that this configuration is stateful; i.e., unsetting anything in here does not reset the value to the default!
]; '';
default = {}; default = {};
example = { example = {
Datastore.StorageMax = "100GB"; Datastore.StorageMax = "100GB";
@ -179,10 +174,8 @@ in {
serviceFdlimit = mkOption { serviceFdlimit = mkOption {
type = types.nullOr types.int; type = types.nullOr types.int;
default = null; default = null;
description = '' description = "The fdlimit for the IPFS systemd unit or <literal>null</literal> to have the daemon attempt to manage it";
The fdlimit for the IPFS systemd unit or `null` to have the daemon attempt to manage it. example = 64*1024;
'';
example = 256*1024;
}; };
}; };
@ -211,7 +204,7 @@ in {
description = "IPFS Initializer"; description = "IPFS Initializer";
after = [ "local-fs.target" ]; after = [ "local-fs.target" ];
before = [ "ipfs.service" "ipfs-offline.service" ]; before = [ "ipfs.service" "ipfs-offline.service" "ipfs-norouting.service" ];
preStart = '' preStart = ''
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir} install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}