From d060978b65b510b3da2f81c9d6e8a66197cdf2d5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 5 Sep 2023 16:20:03 +0000 Subject: [PATCH] home: direnv: allow unfree 'use pkgs' --- home/direnv/lib/nix.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/home/direnv/lib/nix.sh b/home/direnv/lib/nix.sh index e05025b..ec8fa88 100644 --- a/home/direnv/lib/nix.sh +++ b/home/direnv/lib/nix.sh @@ -23,6 +23,11 @@ use_pkgs() { args+=(--impure) shift ;; + -u|--unfree) + args+=(--impure) + export NIXPKGS_ALLOW_UNFREE=1 + shift + ;; --) shift break @@ -46,4 +51,7 @@ use_pkgs() { # shellcheck disable=2154 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_UNFREE }