···
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")
···
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}
43
-
'' + 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}
···
description = "Whether IPFS should try to migrate the file system automatically";
106
-
#autoMount = mkOption {
107
-
# type = types.bool;
109
-
# 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 {
···
config = mkIf cfg.enable {
environment.systemPackages = [ wrapped ];
188
+
environment.etc."fuse.conf" = mkIf cfg.autoMount { text = ''
users.extraUsers = mkIf (cfg.user == "ipfs") {
···
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}
211
-
'' + 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}