From 4a524cf66246212fb2e6d96ee57a65c911d8860e Mon Sep 17 00:00:00 2001 From: Tom Hunger Date: Thu, 23 Feb 2017 09:09:47 +0000 Subject: [PATCH] Allow directories with a default.nix to be imported as an overlay. Closes #23016. Note that ${} substitution doesn't work because of the "cannot refer to other paths" constraint. The paranthesis are needed to enforce right-first evaluation. --- pkgs/top-level/impure.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix index 61ef729fa10..c0f4e0fa089 100644 --- a/pkgs/top-level/impure.nix +++ b/pkgs/top-level/impure.nix @@ -45,7 +45,7 @@ in overlays = dir: let content = readDir dir; in map (n: import (dir + ("/" + n))) - (builtins.filter (n: builtins.match ".*\.nix" n != null) + (builtins.filter (n: builtins.match ".*\.nix" n != null || pathExists (dir + ("/" + n + "/default.nix"))) (attrNames content)); in if dirPath != "" then