From 8bce3034fda3b8d201961d382b55caaa54636e4d Mon Sep 17 00:00:00 2001 From: happysalada Date: Tue, 31 Aug 2021 22:22:36 +0900 Subject: [PATCH] ipfs: add autoMigrate option --- nixos/modules/services/network-filesystems/ipfs.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index c64fd07db8cb..0eaeb9e3ceff 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -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