···
cfg = config.services.ipfs;
9
-
#(optionalString cfg.autoMount "--mount")
9
+
(optionalString cfg.autoMount "--mount")
(optionalString cfg.autoMigrate "--migrate")
(optionalString cfg.enableGC "--enable-gc")
(optionalString (cfg.serviceFdlimit != null) "--manage-fdlimit=false")
···
baseService = recursiveUpdate commonEnv {
wants = [ "ipfs-init.service" ];
40
+
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.Gateway ${cfg.gatewayAddress}
42
-
'' + optionalString false/*cfg.autoMount*/ ''
43
+
'' + optionalString cfg.autoMount ''
ipfs --local config Mounts.FuseAllowOther --json true
ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir}
···
94
-
description = "systemd service that is enabled by default";
type = types.enum [ "online" "offline" "norouting" ];
97
+
description = "systemd service that is enabled by default";
103
-
Whether IPFS should try to migrate the file system automatically.
103
+
description = "Whether IPFS should try to migrate the file system automatically";
107
-
#autoMount = mkOption {
108
-
# type = types.bool;
110
-
# description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
106
+
autoMount = mkOption {
109
+
description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
ipfsMountDir = mkOption {
···
141
-
Whether to enable automatic garbage collection.
139
+
description = "Whether to enable automatic garbage collection";
149
-
If set to true, the repo won't be initialized with help files
145
+
description = "If set to true, the repo won't be initialized with help files";
155
-
description = toString [
156
-
"Attrset of daemon configuration to set using `ipfs config`, every time the daemon starts."
157
-
"These are applied last, so may override configuration set by other options in this module."
158
-
"Keep in mind that this configuration is stateful; i.e., unsetting anything in here does not reset the value to the default!"
151
+
Attrset of daemon configuration to set using <command>ipfs config</command>, every time the daemon starts.
152
+
These are applied last, so may override configuration set by other options in this module.
153
+
Keep in mind that this configuration is stateful; i.e., unsetting anything in here does not reset the value to the default!
Datastore.StorageMax = "100GB";
···
serviceFdlimit = mkOption {
type = types.nullOr types.int;
183
-
The fdlimit for the IPFS systemd unit or `null` to have the daemon attempt to manage it.
185
-
example = 256*1024;
177
+
description = "The fdlimit for the IPFS systemd unit or <literal>null</literal> to have the daemon attempt to manage it";
···
config = mkIf cfg.enable {
environment.systemPackages = [ wrapped ];
188
+
environment.etc."fuse.conf" = mkIf cfg.autoMount { text = ''
users.extraUsers = mkIf (cfg.user == "ipfs") {
···
description = "IPFS Initializer";
after = [ "local-fs.target" ];
214
-
before = [ "ipfs.service" "ipfs-offline.service" ];
210
+
before = [ "ipfs.service" "ipfs-offline.service" "ipfs-norouting.service" ];
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}
218
-
'' + optionalString false/*cfg.autoMount*/ ''
214
+
'' + optionalString cfg.autoMount ''
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipfsMountDir}
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipnsMountDir}