vars: reduce dependency on pkgs

pass pkgs only to generators submodule which is the only place where it is needed because of finalScript
This commit is contained in:
DavHau
2025-07-15 12:14:46 +07:00
parent dc3a41f403
commit 61df393c2d

View File

@@ -27,6 +27,12 @@ let
; ;
# the original types.submodule has strange behavior # the original types.submodule has strange behavior
submodule = submodule =
module:
submoduleWith {
modules = [ module ];
};
submoduleWithPkgs =
module: module:
submoduleWith { submoduleWith {
specialArgs.pkgs = pkgs; specialArgs.pkgs = pkgs;
@@ -44,7 +50,7 @@ in
''; '';
default = { }; default = { };
type = attrsOf ( type = attrsOf (
submodule (generator: { submoduleWithPkgs (generator: {
imports = [ ./generator.nix ]; imports = [ ./generator.nix ];
options = { options = {
name = lib.mkOption { name = lib.mkOption {