ipfs: add autoMigrate option

This commit is contained in:
happysalada 2021-08-31 22:22:36 +09:00
parent 4502d6386e
commit 8bce3034fd

View file

@ -89,6 +89,12 @@ in
description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
};
autoMigrate = mkOption {
type = types.bool;
default = true;
description = "Whether IPFS should try to run the fs-repo-migration at startup.";
};
ipfsMountDir = mkOption {
type = types.str;
default = "/ipfs";
@ -240,6 +246,8 @@ in
ipfs --offline config Mounts.FuseAllowOther --json true
ipfs --offline config Mounts.IPFS ${cfg.ipfsMountDir}
ipfs --offline config Mounts.IPNS ${cfg.ipnsMountDir}
'' + optionalString cfg.autoMigrate ''
${pkgs.ipfs-migrator}/bin/fs-repo-migrations -y
'' + concatStringsSep "\n" (collect
isString
(mapAttrsRecursive