From f0e387b943ddf059147259ad0345bb582f7ae00f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 5 Sep 2023 16:20:27 +0000 Subject: [PATCH] home: direnv: allow broken 'use pkgs' --- home/direnv/lib/nix.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/direnv/lib/nix.sh b/home/direnv/lib/nix.sh index de86dac..a65eb31 100644 --- a/home/direnv/lib/nix.sh +++ b/home/direnv/lib/nix.sh @@ -15,6 +15,11 @@ use_pkgs() { # Allow changing the default flake through a command line switch while true; do case "$1" in + -b|--broken) + args+=(--impure) + export NIXPKGS_ALLOW_BROKEN=1 + shift + ;; -f|--flake) DEFAULT_FLAKE="$2" shift 2 @@ -58,6 +63,7 @@ use_pkgs() { direnv_load nix shell "${args[@]}" "${packages[@]}" --command "$direnv" dump # Clean-up after ourselves (assumes the user does not set them before us) + unset NIXPKGS_ALLOW_BROKEN unset NIXPKGS_ALLOW_INSECURE unset NIXPKGS_ALLOW_UNFREE }