diff --git a/.envrc b/.envrc index 952ec2f8..ede83d9a 100644 --- a/.envrc +++ b/.envrc @@ -2,6 +2,16 @@ dotenv_if_exists -use flake ".#${DIRENV_DEVSHELL:-default}" +system="$(nix eval --impure --raw --expr 'builtins.currentSystem')" +devshell="${DIRENV_DEVSHELL:-default}" + +if command -v nom &> /dev/null && [ -t 0 ]; then + # if nom is available, build the devshell dependencies with it to get nicer + # progress monitoring. Don't do this when stdout is piped, because it shows + # up weird in engage. + nom build ".#devShells.$system.$devshell" +fi + +use flake ".#$devshell" PATH_add bin