diff --git a/home-manager/packages/default.nix b/home-manager/packages/default.nix index 16980df35..74736b1f9 100644 --- a/home-manager/packages/default.nix +++ b/home-manager/packages/default.nix @@ -83,7 +83,6 @@ with pkgs; k6 lean4 lefthook - (if stdenv.isLinux && isDesktop then llama-cpp.override { vulkanSupport = true; } else llama-cpp) llm lnav lsof @@ -151,6 +150,7 @@ with pkgs; keychain libiconv libsecret + (if isDesktop then llama-cpp.override { vulkanSupport = true; } else llama-cpp) opencode openssl openssl.dev diff --git a/home-manager/programs/bash/bash_env.sh b/home-manager/programs/bash/bash_env.sh index 2a6d52e77..afc4167d1 100644 --- a/home-manager/programs/bash/bash_env.sh +++ b/home-manager/programs/bash/bash_env.sh @@ -18,3 +18,8 @@ case ":$PATH:" in *":$HOME/.bun/bin:"*) ;; *) export PATH="$HOME/.bun/bin:$PATH" ;; esac + +case ":$PATH:" in +*":$HOME/.bun/install/global/node_modules/.bin:"*) ;; +*) export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH" ;; +esac diff --git a/home-manager/programs/bash/default.nix b/home-manager/programs/bash/default.nix index 56612b1bf..73ec62897 100644 --- a/home-manager/programs/bash/default.nix +++ b/home-manager/programs/bash/default.nix @@ -84,6 +84,7 @@ export PATH="$HOME/.bun/bin:$PATH" export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH" export PATH="/opt/homebrew/bin:$PATH" + export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH" # Worktrunk shell init if command -v wt >/dev/null 2>&1; then @@ -93,7 +94,7 @@ profileExtra = '' # Local binaries should be present even before login shells source .bashrc. - export PATH="$HOME/.bun/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" + export PATH="$HOME/.bun/install/global/node_modules/.bin:$HOME/.bun/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" # Nix if [ -e ~/.nix-profile/etc/profile.d/nix.sh ]; then diff --git a/home-manager/programs/fish/default.nix b/home-manager/programs/fish/default.nix index bc0a3acc2..922c87e30 100644 --- a/home-manager/programs/fish/default.nix +++ b/home-manager/programs/fish/default.nix @@ -9,7 +9,7 @@ enable = true; shellInit = '' # Local binaries should be available before login/interactive-only PATH setup. - set -gx PATH $HOME/.bun/bin $HOME/.cargo/bin $HOME/.local/bin $PATH + set -gx PATH $HOME/.bun/install/global/node_modules/.bin $HOME/.bun/bin $HOME/.cargo/bin $HOME/.local/bin $PATH # Set XDG_RUNTIME_DIR on Linux for consistent socket paths (e.g., zellij) if test (uname) = "Linux" @@ -55,6 +55,7 @@ fish_add_path -p -m ~/.bun/bin fish_add_path -p -m /opt/homebrew/opt/postgresql@18/bin fish_add_path -p -m /opt/homebrew/bin + fish_add_path -p -m ~/.bun/install/global/node_modules/.bin ''; interactiveShellInit = '' source ${config.home.homeDirectory}/.config/fish/functions/_hm_load_env_file.fish @@ -77,6 +78,7 @@ fish_add_path -p -m ~/.bun/bin fish_add_path -p -m /opt/homebrew/opt/postgresql@18/bin fish_add_path -p -m /opt/homebrew/bin + fish_add_path -p -m ~/.bun/install/global/node_modules/.bin # Worktrunk shell init if type -q wt wt config shell init fish | source diff --git a/home-manager/programs/ssh/default.nix b/home-manager/programs/ssh/default.nix index 4cb1772dd..86bf12b04 100644 --- a/home-manager/programs/ssh/default.nix +++ b/home-manager/programs/ssh/default.nix @@ -1,4 +1,5 @@ -_: { +{ lib, ... }: +{ home.file.".ssh/rc" = { source = ./rc; force = true; @@ -10,7 +11,7 @@ _: { settings = { "*" = { ServerAliveInterval = 60; - IdentityFile = "~/.ssh/id_ed25519"; + IdentityFile = lib.mkForce [ "~/.ssh/id_ed25519" ]; SetEnv = { TERM = "xterm-256color"; }; @@ -28,12 +29,12 @@ _: { "kyber" = { HostName = "kyber.tail950b36.ts.net"; User = "ubuntu"; - IdentityFile = "~/.ssh/id_rsa"; + IdentityFile = [ "~/.ssh/id_rsa" ]; IdentitiesOnly = "yes"; }; "github.com" = { ServerAliveInterval = 0; - IdentityFile = "~/.ssh/id_ed25519_github"; + IdentityFile = [ "~/.ssh/id_ed25519_github" ]; ControlMaster = "auto"; ControlPath = "~/.ssh/github.sock"; ControlPersist = "3m"; diff --git a/home-manager/programs/zsh/default.nix b/home-manager/programs/zsh/default.nix index 4e8a93422..500182fa5 100644 --- a/home-manager/programs/zsh/default.nix +++ b/home-manager/programs/zsh/default.nix @@ -32,7 +32,7 @@ fi # Local binaries must be available to non-interactive zsh commands too. - export PATH="$HOME/.bun/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" + export PATH="$HOME/.bun/install/global/node_modules/.bin:$HOME/.bun/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" # Set XDG_RUNTIME_DIR on Linux for consistent socket paths (e.g., zellij) if [ "$(uname)" = "Linux" ]; then @@ -74,6 +74,7 @@ export PATH="$HOME/.bun/bin:$PATH" export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH" export PATH="/opt/homebrew/bin:$PATH" + export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH" # FNM (Fast Node Manager) configuration ${ diff --git a/spec/atuin_history_spec.sh b/spec/atuin_history_spec.sh index 1af029367..91ac23671 100644 --- a/spec/atuin_history_spec.sh +++ b/spec/atuin_history_spec.sh @@ -111,18 +111,20 @@ The output should include "gomi" End It 'adds local binaries to zsh envExtra for non-interactive commands' -When run bash -c "grep -F 'export PATH=\"\$HOME/.bun/bin:\$HOME/.cargo/bin:\$HOME/.local/bin:\$PATH\"' '$ZSH_CONFIG'" +When run bash -c "grep -F 'export PATH=\"\$HOME/.bun/install/global/node_modules/.bin:\$HOME/.bun/bin:\$HOME/.cargo/bin:\$HOME/.local/bin:\$PATH\"' '$ZSH_CONFIG'" The status should be success The output should include '.local/bin' The output should include '.bun/bin' +The output should include '.bun/install/global/node_modules/.bin' The output should include '.cargo/bin' End It 'adds local binaries to bash profileExtra before bashrc' -When run bash -c "grep -F 'export PATH=\"\$HOME/.bun/bin:\$HOME/.cargo/bin:\$HOME/.local/bin:\$PATH\"' '$BASH_CONFIG'" +When run bash -c "grep -F 'export PATH=\"\$HOME/.bun/install/global/node_modules/.bin:\$HOME/.bun/bin:\$HOME/.cargo/bin:\$HOME/.local/bin:\$PATH\"' '$BASH_CONFIG'" The status should be success The output should include '.local/bin' The output should include '.bun/bin' +The output should include '.bun/install/global/node_modules/.bin' The output should include '.cargo/bin' End @@ -142,11 +144,30 @@ The output should include '.local/bin' End It 'adds local binaries to fish shellInit before login-only setup' -When run bash -c "grep -F 'set -gx PATH \$HOME/.bun/bin \$HOME/.cargo/bin \$HOME/.local/bin \$PATH' '$FISH_CONFIG'" +When run bash -c "grep -F 'set -gx PATH \$HOME/.bun/install/global/node_modules/.bin \$HOME/.bun/bin \$HOME/.cargo/bin \$HOME/.local/bin \$PATH' '$FISH_CONFIG'" The status should be success The output should include '.local/bin' The output should include '.bun/bin' +The output should include '.bun/install/global/node_modules/.bin' The output should include '.cargo/bin' End + +It 'prepends bun global node_modules/.bin after homebrew in bash initExtra so it wins on macOS' +When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$BASH_CONFIG'" +The status should be success +The output should eq 'ok' +End + +It 'prepends bun global node_modules/.bin after homebrew in zsh initContent so it wins on macOS' +When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$ZSH_CONFIG'" +The status should be success +The output should eq 'ok' +End + +It 'prepends bun global node_modules/.bin after homebrew in fish loginShellInit so it wins on macOS' +When run bash -c "awk '/fish_add_path -p -m \\/opt\\/homebrew\\/bin/{brew=NR} /fish_add_path -p -m ~\\/.bun\\/install\\/global\\/node_modules\\/.bin/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$FISH_CONFIG'" +The status should be success +The output should eq 'ok' +End End End diff --git a/spec/ssh_config_spec.sh b/spec/ssh_config_spec.sh index 298d510eb..1915991bf 100644 --- a/spec/ssh_config_spec.sh +++ b/spec/ssh_config_spec.sh @@ -13,7 +13,7 @@ End It 'pins the Codex-compatible SSH identity' When run cat "$SSH_CONFIG_NIX" -The output should include 'IdentityFile = "~/.ssh/id_rsa"' +The output should include 'IdentityFile = [ "~/.ssh/id_rsa" ]' The output should include 'IdentitiesOnly = "yes"' End End