nixos-configs/packages/nbted/default.nix
matt1432 85035da7a1
All checks were successful
Discord / discord commits (push) Has been skipped
feat(mc): add nbted package to edit NBT
2025-03-11 12:49:33 -04:00

39 lines
886 B
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
...
}:
rustPlatform.buildRustPackage rec {
pname = "nbted";
version = "1.5.0";
src = fetchFromGitHub {
owner = "C4K3";
repo = pname;
tag = version;
hash = "sha256-5gCxTFjI3WDC9+F9i4I2g17+wHWnQHjC4Hurj5CMhB4=";
};
cargoLock.lockFile = "${src}/Cargo.lock";
env.OUT_DIR = "$out";
patchPhase = ''
export OUT_DIR=$(mktemp -d)
rm ./build.rs
echo '"${version}"' > $OUT_DIR/git-revision.txt
substituteInPlace ./Cargo.toml --replace-fail "build = \"build.rs\"" ""
'';
meta = {
mainProgram = pname;
license = lib.licenses.cc0;
homepage = "https://github.com/C4K3/nbted";
description = ''
Command-line NBT editor written in Rust. It does precisely one thing: convert NBT files to
a pretty text format, and reverse the pretty text format back into NBT.
'';
};
}