Files

44 lines
1.2 KiB
Nix

{
lib,
fetchFromGitHub,
nix-update-script,
rustPlatform,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "gdscript-formatter";
version = "0.24.0";
src = fetchFromGitHub {
owner = "GDQuest";
repo = "GDScript-formatter";
tag = finalAttrs.version;
hash = "sha256-dcA4U4bxFBSL41m+2svxl18iKMuExOf30c0Rcepaa8g=";
# Needed due to .gitattributes being used for the Godot addon and export-ignoring all files
deepClone = true;
# Avoid hash differences due to differences in .git
leaveDotGit = false;
};
cargoHash = "sha256-D3a4DMzxS+UFM8HDSG58LC3joyaT/hFpgx3YmIEdPLI=";
cargoBuildFlags = [
"--bin=gdscript-formatter"
];
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Fast code formatter for GDScript and Godot 4";
homepage = "https://github.com/GDQuest/GDScript-formatter";
changelog = "https://github.com/GDQuest/GDScript-formatter/blob/${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.mit;
mainProgram = "gdscript-formatter";
maintainers = with lib.maintainers; [ squarepear ];
};
})