{ lib, fetchFromGitHub, nix-update-script, rustPlatform, versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "gdscript-formatter"; version = "0.18.2"; src = fetchFromGitHub { owner = "GDQuest"; repo = "GDScript-formatter"; tag = finalAttrs.version; hash = "sha256-V9zrL2Aku5e+9McXpXdXvsGJKjqVXIIaAsoAF2xHB4g="; # 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-xqGmv/e1Ch/EqutIb2claiJ8fQGDDdOriOZdt8SR8mw="; 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 ]; }; })