From ba253d5c6453e3776848a43a3befdbf6b91c4ee3 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:46:13 -0700 Subject: [PATCH] arduino --- extras/dev.nix | 34 +++++++++++++++++-------------- users/tao/helix.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/extras/dev.nix b/extras/dev.nix index 3002cdd..2669876 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -1,29 +1,30 @@ -{ - inputs, - pkgs, - ... -}: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ - arduino-language-server - arduino-cli - tio - radicle-cli - lua-language-server - # freecad - # vulkan-loader - # gh # etcher + # freecad + # gh + # vulkan-loader hyperfine jq + jujutsu just lldb + lua-language-server + radicle-cli sd sqlite sqlx-cli sshfs - tokei - jujutsu taplo + tio + tokei + + # arduino + arduino-language-server + arduino-cli + pkgsCross.avr.buildPackages.gcc + avrdude + ravedude # c clang @@ -57,6 +58,9 @@ #rust bacon + cargo-feature + cargo-generate + bacon elf2uf2-rs mdbook mold-wrapped diff --git a/users/tao/helix.nix b/users/tao/helix.nix index 0c57fec..ab64785 100644 --- a/users/tao/helix.nix +++ b/users/tao/helix.nix @@ -43,6 +43,21 @@ }; languages = { language = [ + { + name = "arduino"; + scope = "source.arduino"; + injection-regex = "arduino"; + file-types = ["ino" "cpp" "h"]; + comment-token = "//"; + roots = ["*.ino" "sketch.yaml"]; + language-servers = ["arduino-language-server"]; + indent = { + tab-width = 8; + unit = "\t"; + }; + auto-format = true; + formatter = {command = "clang-format";}; + } { name = "c"; auto-format = true; @@ -62,6 +77,30 @@ command = "clang-format"; args = ["--style=file:/home/tao/Templates/clang-format"]; }; + file-types = [ + "cc" + "hh" + "c++" + "cpp" + "hpp" + "h" + "ipp" + "tpp" + "cxx" + "hxx" + "ixx" + "txx" + "C" + "H" + "cu" + "cuh" + "cppm" + "h++" + "ii" + "inl" + {glob = ".hpp.in";} + {glob = ".h.in";} + ]; indent = { tab-width = 8; unit = "\t"; @@ -124,8 +163,18 @@ command = "jdtls"; args = ["-data" "/home/tao/.cache/jdtls/workspace"]; }; + arduino-language-server = { + command = "arduino-language-server"; + }; }; grammar = [ + { + name = "arduino"; + source = { + git = "https://github.com/ObserverOfTime/tree-sitter-arduino"; + rev = "db929fc6822b9b9e1211678d508f187894ce0345"; + }; + } ]; }; enable = true;