From 76eb12e51babc7a28cf0c795490e99bcef459e57 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Thu, 20 Apr 2023 18:19:33 -0700 Subject: [PATCH] Allow root module to be a function --- default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 9b64c8a..9b7d10e 100644 --- a/default.nix +++ b/default.nix @@ -339,8 +339,9 @@ let # Root module with autoloads, normalization, and additional attrs. root' = let - nixDir = root.nixDir or (src + ./nix); - fullRoot = (autoImportAttrs nixDir rootAttrs) // root; + resolvedRoot = applyNonSysArgs root; + nixDir = resolvedRoot.nixDir or (src + ./nix); + fullRoot = (autoImportAttrs nixDir rootAttrs) // resolvedRoot; in normalizeModule fullRoot // { modules = fullRoot.modules or @@ -352,7 +353,6 @@ let perSystem = filterArgs (fullRoot.perSystem or { }); outputs = applyNonSysArgs (fullRoot.outputs or { }); inherit nixDir; - raw = root; }; modules = [ baseModule ] ++ builtinModules ++ root'.modules;