Body:
I’m encountering an issue in Project IDX where the Azure CLI (az
) command is not found in the terminal, even though I’ve included pkgs.azure-cli
in my dev.nix
file.
Here’s the relevant part of my dev.nix
file:
nix { pkgs ? import {}, … }: { # Which nixpkgs channel to use. channel = “stable-24.05”; # Use NixOS Search to find packages packages = [ # … other packages … pkgs.azure-cli ]; # … other configurations … }
text (auto)
When I try to run az --version
in the terminal, I get the error: /usr/bin/bash: line 1: az: command not found
.
I’ve already tried the following troubleshooting steps:
- Rebuilding the environment (multiple times)
- Explicitly sourcing the environment using
nix-shell
- Activating the virtual environment (though I believe
az
should be available outside the virtual environment as it’s a system package) - Checking the
NIX_PATH
environment variable (it’s set to a standard value:/nix/var/nix/profiles/per-user/root/channels
) - Running the command with
nix-shell --run "az --version"
(which resulted in an “undefined variable ‘nix’” error, strangely)
I’m using Project IDX, which utilizes Nix for environment management. I’m not sure why az
is not accessible even though it’s specified in dev.nix
.
Has anyone else encountered this issue or have suggestions on how to troubleshoot it further? Any help would be greatly appreciated.