diff --git a/pkgs/by-name/ai/air-formatter/cargo-lock.patch b/pkgs/by-name/ai/air-formatter/cargo-lock.patch new file mode 100644 index 000000000000..ed47ef1f98b9 --- /dev/null +++ b/pkgs/by-name/ai/air-formatter/cargo-lock.patch @@ -0,0 +1,84 @@ +diff --git a/Cargo.lock b/Cargo.lock +index df5a6e9..0cf72e2 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -382,7 +382,7 @@ dependencies = [ + "anyhow", + "biome_rowan", + "rustc-hash", +- "tower-lsp 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tower-lsp", + ] + + [[package]] +@@ -1369,7 +1369,7 @@ dependencies = [ + "time", + "tokio", + "tokio-util", +- "tower-lsp 0.20.0 (git+https://github.com/lionel-/tower-lsp?branch=bugfix%2Fpatches)", ++ "tower-lsp", + "tracing", + "tracing-subscriber", + "tree-sitter", +@@ -1406,7 +1406,7 @@ dependencies = [ + "serde_json", + "tokio", + "tokio-util", +- "tower-lsp 0.20.0 (git+https://github.com/lionel-/tower-lsp?branch=bugfix%2Fpatches)", ++ "tower-lsp", + "tracing", + "url", + ] +@@ -2311,29 +2311,6 @@ version = "0.3.3" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +-[[package]] +-name = "tower-lsp" +-version = "0.20.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" +-dependencies = [ +- "async-trait", +- "auto_impl", +- "bytes", +- "dashmap 5.5.3", +- "futures", +- "httparse", +- "lsp-types", +- "memchr", +- "serde", +- "serde_json", +- "tokio", +- "tokio-util", +- "tower", +- "tower-lsp-macros 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "tracing", +-] +- + [[package]] + name = "tower-lsp" + version = "0.20.0" +@@ -2352,21 +2329,10 @@ dependencies = [ + "tokio", + "tokio-util", + "tower", +- "tower-lsp-macros 0.9.0 (git+https://github.com/lionel-/tower-lsp?branch=bugfix%2Fpatches)", ++ "tower-lsp-macros", + "tracing", + ] + +-[[package]] +-name = "tower-lsp-macros" +-version = "0.9.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" +-dependencies = [ +- "proc-macro2", +- "quote", +- "syn 2.0.90", +-] +- + [[package]] + name = "tower-lsp-macros" + version = "0.9.0" diff --git a/pkgs/by-name/ai/air-formatter/package.nix b/pkgs/by-name/ai/air-formatter/package.nix new file mode 100644 index 000000000000..e489b2cfa0e9 --- /dev/null +++ b/pkgs/by-name/ai/air-formatter/package.nix @@ -0,0 +1,33 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, +}: +rustPlatform.buildRustPackage (attrs: { + pname = "air-formatter"; + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "posit-dev"; + repo = "air"; + rev = attrs.version; + hash = "sha256-BUbOG4D5UD+Z8Cpr4qodUrM3FFcMwjBd4M/YdPZPtpM="; + }; + + # Remove duplicate entries from cargo lock + cargoPatches = [ ./cargo-lock.patch ]; + + useFetchCargoVendor = true; + cargoHash = "sha256-EnvhqAZK76O6g99OgLruQDBUe9m9bn5ier3bgHI/f+A="; + + useNextest = true; + + meta = { + description = "An extremely fast R code formatter"; + homepage = "https://posit-dev.github.io/air"; + changelog = "https://github.com/posit-dev/air/blob/" + attrs.version + "/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.kupac ]; + mainProgram = "air"; + }; +})