From 7851bc67518ff258498b346859393c37a4d4126a Mon Sep 17 00:00:00 2001 From: guangtao Date: Fri, 29 Sep 2023 03:15:10 -0700 Subject: [PATCH] refactor: remove outputsForTarget --- src/haumea/nixosModules.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/haumea/nixosModules.nix b/src/haumea/nixosModules.nix index 6232172..100bc26 100644 --- a/src/haumea/nixosModules.nix +++ b/src/haumea/nixosModules.nix @@ -35,6 +35,12 @@ let ) ) )); + + isEvalModule = l.elem cfg.type [ + "nixosModules" + "evalModules" + ]; + base = { extenders ? [ ], @@ -66,9 +72,13 @@ let inherit mkModulePath; moduleArgs = config._module.args // config._module.specialArgs; } - // l.optionalAttrs (cfg == "nixosModules" || cfg.type == "nixosProfiles") { - pkgs = config._module.args.pkgs; - } + // + l.optionalAttrs + (l.elem cfg.type [ + "nixosModules" + "nixosProfiles" + ]) + { pkgs = config._module.args.pkgs; } ) ); @@ -92,7 +102,7 @@ let s3Module = mkExtenders (winnow path s3 mkModulePath) path; s3Profile = mkExtenders s3 path; in - if cfg.type == "nixosModules" then s3Module else s3Profile; + if isEvalModule then s3Module else s3Profile; mkExtenders = module: path: