summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems/ipfs.nix
diff options
context:
space:
mode:
authorKevin Cox <kevincox@kevincox.ca>2021-08-31 09:33:20 -0400
committerGitHub <noreply@github.com>2021-08-31 09:33:20 -0400
commit3106d032f73117b33ca3c47ce5d7db7e0a49983b (patch)
treef3071c088f76f25f77d68130d3e7515fccb56429 /nixos/modules/services/network-filesystems/ipfs.nix
parent60adf763357f7ae4b51b945ac967cb46c747d9ea (diff)
parent8bce3034fda3b8d201961d382b55caaa54636e4d (diff)
downloadnixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar.gz
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar.bz2
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar.lz
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar.xz
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.tar.zst
nixpkgs-3106d032f73117b33ca3c47ce5d7db7e0a49983b.zip
Merge pull request #136261 from happysalada/ipfs_auto_migrations
Ipfs auto migrations
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 57eae46b17a..57f5f6b006c 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";
@@ -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