From ffc8ec5c9ae6cf7b3bb95866432e30e46e7cc731 Mon Sep 17 00:00:00 2001 From: Malo Bourgon Date: Sun, 14 Aug 2022 14:04:20 -0700 Subject: Add .nix-defexpr to NIX_PATH the way the NixOS module does --- modules/system/checks.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/system') diff --git a/modules/system/checks.nix b/modules/system/checks.nix index 2af25c8..4ce6991 100644 --- a/modules/system/checks.nix +++ b/modules/system/checks.nix @@ -125,7 +125,9 @@ let ''; nixPath = '' - darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --find-file darwin-config) || true + nixPath=${concatStringsSep ":" config.nix.nixPath}:$HOME/.nix-defexpr/channels + + darwinConfig=$(NIX_PATH=$nixPath nix-instantiate --find-file darwin-config) || true if ! test -e "$darwinConfig"; then echo "error: Changed but target does not exist, aborting activation" >&2 echo "Create ''${darwinConfig:-~/.nixpkgs/darwin-configuration.nix} or set environment.darwinConfig:" >&2 @@ -139,7 +141,7 @@ let exit 2 fi - darwinPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --find-file darwin) || true + darwinPath=$(NIX_PATH=$nixPath nix-instantiate --find-file darwin) || true if ! test -e "$darwinPath"; then echo "error: Changed but target does not exist, aborting activation" >&2 echo "Add the darwin repo as a channel or set nix.nixPath:" >&2 @@ -153,7 +155,7 @@ let exit 2 fi - nixpkgsPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --find-file nixpkgs) || true + nixpkgsPath=$(NIX_PATH=$nixPath nix-instantiate --find-file nixpkgs) || true if ! test -e "$nixpkgsPath"; then echo "error: Changed but target does not exist, aborting activation" >&2 echo "Add a nixpkgs channel or set nix.nixPath:" >&2 -- cgit v1.2.3