Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
{
description = "Migrate your app to Rust, one piece at a time, checked against the original's recorded behavior";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
{
packages = forAllSystems (pkgs: {
default = pkgs.rustPlatform.buildRustPackage {
pname = "rust-anything";
inherit (cargoToml.package) version;
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./Cargo.toml
./Cargo.lock
./src
./skills
];
};
cargoLock.lockFile = ./Cargo.lock;
doCheck = false;
meta = {
inherit (cargoToml.package) description homepage;
license = with pkgs.lib.licenses; [
mit
asl20
];
mainProgram = "rust-anything";
};
};
});
apps = forAllSystems (pkgs: {
default = {
type = "app";
program = pkgs.lib.getExe self.packages.${pkgs.stdenv.hostPlatform.system}.default;
meta.description = "Run rust-anything";
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.stdenv.hostPlatform.system}.default ];
packages = with pkgs; [
clippy
rustfmt
rust-analyzer
];
};
});
};
}