From 5f99ae760ba1ba2eb3394a876f2fd9354e74d3a3 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Sun, 28 Apr 2024 10:56:51 -0700 Subject: [PATCH] boxxy arduino --- extras/dev.nix | 1 + users/tao/HOME.nix | 2 +- users/tao/boxxy.nix | 18 ++++++++- users/tao/helix.nix | 21 +++++----- users/tao/nushell/stuff.nu | 39 +++++++++++++------ ...f.sync-conflict-20240428-223135-34PB6X7.nu | 36 +++++++++++++++++ 6 files changed, 94 insertions(+), 23 deletions(-) create mode 100644 users/tao/nushell/stuff.sync-conflict-20240428-223135-34PB6X7.nu diff --git a/extras/dev.nix b/extras/dev.nix index 58f1a1c..828234c 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -4,6 +4,7 @@ # freecad # gh # vulkan-loader + fontforge direnv qFlipper hyperfine diff --git a/users/tao/HOME.nix b/users/tao/HOME.nix index 64a1912..d662d36 100644 --- a/users/tao/HOME.nix +++ b/users/tao/HOME.nix @@ -8,7 +8,7 @@ cargoConfig = builtins.replaceStrings ["path/to/sccache"] ["${pkgs.sccache}/bin/sccache"] cargoFile; in { imports = [ - # ./boxxy.nix + ./boxxy.nix (import ./helix.nix {inherit pkgs inputs;}) # ./plasma.nix # ./firefox.nix diff --git a/users/tao/boxxy.nix b/users/tao/boxxy.nix index b364903..432dee9 100644 --- a/users/tao/boxxy.nix +++ b/users/tao/boxxy.nix @@ -1,6 +1,22 @@ { programs.boxxy = { - rules = []; + rules = [ + { + name = "arduino-cli"; + target = "~/.arduino15"; + rewrite = "~/.local/share/arduino/cli"; + } + { + name = "arduino-cli"; + target = "~/Arduino"; + rewrite = "~/.local/share/arduino/ide"; + } + { + name = "arduino-cli"; + target = "~/.jssc"; + rewrite = "~/.local/share/arduino/jssc"; + } + ]; enable = true; }; } diff --git a/users/tao/helix.nix b/users/tao/helix.nix index 0a09c6e..860e648 100644 --- a/users/tao/helix.nix +++ b/users/tao/helix.nix @@ -65,7 +65,10 @@ unit = "\t"; }; auto-format = true; - formatter = {command = "clang-format";}; + formatter = { + command = "clang-format"; + args = ["--style=file:/home/tao/Templates/clang-format"]; + }; } { name = "c"; @@ -86,6 +89,10 @@ command = "clang-format"; args = ["--style=file:/home/tao/Templates/clang-format"]; }; + indent = { + tab-width = 8; + unit = "\t"; + }; file-types = [ "cc" "hh" @@ -110,12 +117,7 @@ {glob = ".hpp.in";} {glob = ".h.in";} ]; - indent = { - tab-width = 8; - unit = "\t"; - }; } - # { name = "css"; comment = "/*"; } { name = "html"; auto-format = false; @@ -173,15 +175,16 @@ args = ["-data" "/home/tao/.cache/jdtls/workspace"]; }; arduino-language-server = { - command = "arduino-language-server"; + command = "boxxy"; + args = ["arduino-language-server" "-cli" "arduino-cli" "-cli-config" "~/.local/share/arduino/cli/arduino-cli.yaml" "-jobs" "0"]; }; }; grammar = [ { name = "arduino"; source = { - git = "https://github.com/ObserverOfTime/tree-sitter-arduino"; - rev = "db929fc6822b9b9e1211678d508f187894ce0345"; + git = "https://github.com/tree-sitter-grammars/tree-sitter-arduino"; + rev = "8518c3fa6b8562af545a496d55c9abd78f53e732"; }; } ]; diff --git a/users/tao/nushell/stuff.nu b/users/tao/nushell/stuff.nu index 6470684..0ed974e 100644 --- a/users/tao/nushell/stuff.nu +++ b/users/tao/nushell/stuff.nu @@ -9,33 +9,48 @@ def bump [] { sudo nixos-rebuild boot --flake /home/tao/projects/NOflake/ --impure --verbose } +def l [ + path? + flags? +] { + if $path == null { + # ls $flags + ls + } else { + # ls $flags $path + ls $path + } | sort-by type name -i +} + def tse [exit_node] { tailscale set --exit-node=$exit_node } +def rb [] { + sudo nice -n19 nixos-rebuild boot --flake . --impure --verbose + hx --grammar fetch; hx --grammar build +} + +def rs [] { + sudo nice -n19 nixos-rebuild boot --flake . --impure --verbose + hx --grammar fetch; hx --grammar build +} + + +alias ard = arduino-cli +alias arduino-cli = boxxy arduino-cli alias b = btm; alias cringe = sudo bootctl set-oneshot auto-windows alias fetch = neofetch alias ff = firefox alias gc = sudo nix-collect-garbage -d --verbose -alias js = jj status alias jd = jj diff +alias js = jj status alias pu = pueue -alias rb = sudo nice -n19 nixos-rebuild boot --flake . --impure --verbose -alias rs = sudo nice -n19 nixos-rebuild switch --flake . --impure --verbose alias t = task alias ts = tailscale alias tss = tailscale status alias tsx = tailscale exit-node list alias zl = zellij -def l [] { - ls | sort-by type -} - -def c [$path] { - cd $path; - l; -} - task diff --git a/users/tao/nushell/stuff.sync-conflict-20240428-223135-34PB6X7.nu b/users/tao/nushell/stuff.sync-conflict-20240428-223135-34PB6X7.nu new file mode 100644 index 0000000..2a70b81 --- /dev/null +++ b/users/tao/nushell/stuff.sync-conflict-20240428-223135-34PB6X7.nu @@ -0,0 +1,36 @@ +source ~/.cache/starship/init.nu +source ~/.zoxide.nu + +def bump [] { + cd /home/tao/projects/NOflake/; + jj new -m "bump"; + nix flake update; + # rc2nix | save -f /home/tao/projects/NOflake/users/tao/plasma.nix; + sudo nixos-rebuild boot --flake /home/tao/projects/NOflake/ --impure --verbose; +}; + +def tse [exit_node] { + tailscale set --exit-node=$exit_node +} + +alias b = btm; +alias cringe = sudo bootctl set-oneshot auto-windows +alias fetch = neofetch +alias ff = firefox +alias gc = sudo nix-collect-garbage -d --verbose +alias js = jj status +alias jd = jj diff +alias pu = pueue +alias rb = sudo nice -n19 nixos-rebuild boot --flake . --impure --verbose +alias rs = sudo nice -n19 nixos-rebuild switch --flake . --impure --verbose +alias t = task +alias ts = tailscale +alias tss = tailscale status +alias tsx = tailscale exit-node list +alias zl = zellij + +def l [] { + ls | sort-by type +} + +task