home: direnv: allow broken 'use pkgs'
All checks were successful
ci/woodpecker/push/check Pipeline was successful

This commit is contained in:
Bruno BELANYI 2023-09-05 16:20:27 +00:00
parent 96a2c62e94
commit f0e387b943

View file

@ -15,6 +15,11 @@ use_pkgs() {
# Allow changing the default flake through a command line switch # Allow changing the default flake through a command line switch
while true; do while true; do
case "$1" in case "$1" in
-b|--broken)
args+=(--impure)
export NIXPKGS_ALLOW_BROKEN=1
shift
;;
-f|--flake) -f|--flake)
DEFAULT_FLAKE="$2" DEFAULT_FLAKE="$2"
shift 2 shift 2
@ -58,6 +63,7 @@ use_pkgs() {
direnv_load nix shell "${args[@]}" "${packages[@]}" --command "$direnv" dump direnv_load nix shell "${args[@]}" "${packages[@]}" --command "$direnv" dump
# Clean-up after ourselves (assumes the user does not set them before us) # Clean-up after ourselves (assumes the user does not set them before us)
unset NIXPKGS_ALLOW_BROKEN
unset NIXPKGS_ALLOW_INSECURE unset NIXPKGS_ALLOW_INSECURE
unset NIXPKGS_ALLOW_UNFREE unset NIXPKGS_ALLOW_UNFREE
} }