summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems/ipfs.nix
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2021-08-31 22:22:36 +0900
committerhappysalada <raphael@megzari.com>2021-08-31 22:22:36 +0900
commit8bce3034fda3b8d201961d382b55caaa54636e4d (patch)
tree3c22a5a29ac6d93123136223b1be2bc5324b1d72 /nixos/modules/services/network-filesystems/ipfs.nix
parent4502d6386e3e35f7297497075a22226f05ea44b5 (diff)
downloadnixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar.gz
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar.bz2
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar.lz
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar.xz
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.tar.zst
nixpkgs-8bce3034fda3b8d201961d382b55caaa54636e4d.zip
ipfs: add autoMigrate option
Diffstat (limited to 'nixos/modules/services/network-filesystems/ipfs.nix')
-rw-r--r--nixos/modules/services/network-filesystems/ipfs.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index c64fd07db8c..0eaeb9e3cef 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