From 61df393c2da6556765916bdbe1f4783cec427f96 Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 15 Jul 2025 12:14:46 +0700 Subject: [PATCH] vars: reduce dependency on pkgs pass pkgs only to generators submodule which is the only place where it is needed because of finalScript --- nixosModules/clanCore/vars/interface.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixosModules/clanCore/vars/interface.nix b/nixosModules/clanCore/vars/interface.nix index 7699b424d..7ce805cbc 100644 --- a/nixosModules/clanCore/vars/interface.nix +++ b/nixosModules/clanCore/vars/interface.nix @@ -27,6 +27,12 @@ let ; # the original types.submodule has strange behavior submodule = + module: + submoduleWith { + modules = [ module ]; + }; + + submoduleWithPkgs = module: submoduleWith { specialArgs.pkgs = pkgs; @@ -44,7 +50,7 @@ in ''; default = { }; type = attrsOf ( - submodule (generator: { + submoduleWithPkgs (generator: { imports = [ ./generator.nix ]; options = { name = lib.mkOption {