Merge pull request #136261 from happysalada/ipfs_auto_migrations

Ipfs auto migrations
This commit is contained in:
Kevin Cox 2021-08-31 09:33:20 -04:00 committed by GitHub
commit 3106d032f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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";
@ -243,6 +249,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