diff --git a/hosts/pinwheel/modules/work/default.nix b/hosts/pinwheel/modules/work/default.nix index 366efe4..bdff793 100644 --- a/hosts/pinwheel/modules/work/default.nix +++ b/hosts/pinwheel/modules/work/default.nix @@ -12,6 +12,18 @@ let in { home-manager.users.alex = { + # Ensure bashInteractive is first in PATH inside nix devshells. + # stdenv provides a non-interactive bash that breaks Copilot shell commands. + # Adding bashInteractive to home.packages alone isn't enough because devshell + # packages are prepended to PATH. This precmd hook runs after direnv's hook + # and re-prepends bashInteractive so it takes priority. + programs.zsh.initContent = '' + _ensure_bash_interactive() { + [[ "$PATH" == "${pkgs.bashInteractive}/bin:"* ]] || export PATH="${pkgs.bashInteractive}/bin:$PATH" + } + precmd_functions+=(_ensure_bash_interactive) + ''; + home.sessionVariables = { GITHUB_ACTOR = "Alexander Heldt"; GITHUB_TOKEN = "$(${pkgs.coreutils}/bin/cat ${config.age.secrets.work-github-token.path})"; @@ -25,6 +37,7 @@ in "IdeaVIM" "com.github.copilot" ]) + pkgs.bashInteractive (pkgs.google-cloud-sdk.withExtraComponents [ pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin