clean up eval_expression

This commit is contained in:
figsoda 2023-01-08 12:32:46 -05:00
parent e386585a0e
commit 435a533439

View File

@ -73,9 +73,11 @@ def eval_expression(
"""
else:
let_bindings = f"""
inputs = if (builtins.functionArgs (import {import_path})) ? overlays then {{ overlays = [ ]; }} else {{ }};
system = if (builtins.functionArgs (import {import_path})) ? system then {{ system = {system}; }} else {{ }};
pkg = (import {import_path} (inputs // system)).{attr};
pkgs = import {import_path};
args = builtins.functionArgs pkgs;
inputs = (if args ? system then {{ system = {system}; }} else {{}}) //
(if args ? overlays then {{ overlays = [ ]; }} else {{}});
pkg = (pkgs inputs).{attr};
sanitizePosition = x: x;
"""