home: direnv: allow insecure 'use pkgs'

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

View file

@ -23,6 +23,11 @@ use_pkgs() {
args+=(--impure) args+=(--impure)
shift shift
;; ;;
-s|--insecure)
args+=(--impure)
export NIXPKGS_ALLOW_INSECURE=1
shift
;;
-u|--unfree) -u|--unfree)
args+=(--impure) args+=(--impure)
export NIXPKGS_ALLOW_UNFREE=1 export NIXPKGS_ALLOW_UNFREE=1
@ -53,5 +58,6 @@ 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_INSECURE
unset NIXPKGS_ALLOW_UNFREE unset NIXPKGS_ALLOW_UNFREE
} }