Skip to content

Commit 9e2866d

Browse files
committed
kubo-migrator: rewrite
- Migrate to pkgs/by-name - Format with nixfmt-rfc-style - Make it possible to remove support for very old migrations in the future by increasing the `minRepoVersion` parameter - Rename kubo-migrator-all-fs-repo-migrations to kubo-fs-repo-migrations since it may no longer include all migrations - Add an alias for kubo-migrator-all-fs-repo-migrations to keep backwards compatibility - Update descriptions to differentiate between kubo-migrator and kubo-migrator-unwrapped and better describe the purpose of the migrator - Add a description to every individual migration - Add a description to kubo-fs-repo-migrations - Fetch the source code of the individual migrations from their specific Git tags, like upstream intends - Enable tests for some migrations - Check that the migrations don't crash on startup - Mark two broken migrations as broken. They are not compatible with the latest Go versions and upstream is not interested in fixing this - Change code to allow most updates to be done by only changing three lines (add new version and change git tag and hash) - Add a stub for any disabled or broken migration to prevent downloading unsigned binaries from the internet, see ipfs/fs-repo-migrations#148 (comment) and ipfs/fs-repo-migrations#188 - Use `lib.getExe` instead of hardcoding the binary name in the kubo NixOS module - Use `substituteInPlace` with `--replace-fail` instead of `--replace`
1 parent 5624e13 commit 9e2866d

File tree

10 files changed

+319
-147
lines changed

10 files changed

+319
-147
lines changed

nixos/modules/services/network-filesystems/kubo.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ in
339339
# After an unclean shutdown this file may exist which will cause the config command to attempt to talk to the daemon. This will hang forever if systemd is holding our sockets open.
340340
rm -vf "$IPFS_PATH/api"
341341
'' + lib.optionalString cfg.autoMigrate ''
342-
${pkgs.kubo-migrator}/bin/fs-repo-migrations -to '${cfg.package.repoVersion}' -y
342+
'${lib.getExe pkgs.kubo-migrator}' -to '${cfg.package.repoVersion}' -y
343343
'' + ''
344344
fi
345345
ipfs --offline config show |

pkgs/applications/networking/kubo-migrator/all-migrations.nix

Lines changed: 0 additions & 82 deletions
This file was deleted.

pkgs/applications/networking/kubo-migrator/default.nix

Lines changed: 0 additions & 23 deletions
This file was deleted.

pkgs/applications/networking/kubo-migrator/unwrapped.nix

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)