nixpkgs/pkgs/by-name/ku/kubo-migrator/package.nix
Luflosi 9e2866d215
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 https://github.com/ipfs/fs-repo-migrations/issues/148#issuecomment-2351355627 and https://github.com/ipfs/fs-repo-migrations/issues/188
- Use `lib.getExe` instead of hardcoding the binary name in the kubo NixOS module
- Use `substituteInPlace` with `--replace-fail` instead of `--replace`
2024-11-20 16:17:14 +01:00

27 lines
571 B
Nix

{
lib,
buildEnv,
makeWrapper,
kubo-migrator-unwrapped,
kubo-fs-repo-migrations,
}:
buildEnv {
name = "kubo-migrator-${kubo-migrator-unwrapped.version}";
nativeBuildInputs = [ makeWrapper ];
paths = [ kubo-migrator-unwrapped ];
pathsToLink = [ "/bin" ];
postBuild = ''
wrapProgram "$out/bin/fs-repo-migrations" \
--prefix PATH ':' '${lib.makeBinPath [ kubo-fs-repo-migrations ]}'
'';
meta = kubo-migrator-unwrapped.meta // {
description = "Run the appripriate migrations for migrating the filesystem repository of Kubo";
};
}