home: direnv: allow specifying default flake

This commit is contained in:
Bruno BELANYI 2022-04-13 10:04:38 +02:00
parent 9a57ba02b7
commit ed8aae565e
2 changed files with 18 additions and 3 deletions

View file

@ -7,7 +7,8 @@ use_pkgs() {
return 1
fi
local DEFAULT_FLAKE="pkgs"
# Use user-provided default value, or fallback to nixpkgs
local DEFAULT_FLAKE="${DIRENV_DEFAULT_FLAKE:-nixpkgs}"
# Allow changing the default flake through a command line switch
if [ "$1" = "-f" ] || [ "$1" = "--flake" ]; then