From 9ea903dde6de65c85532995e5872ad7d2e6e6f5f Mon Sep 17 00:00:00 2001 From: technofab Date: Tue, 26 Aug 2025 12:56:04 +0200 Subject: [PATCH] feat(builder): default to systems from inputs if exists --- lib/core/builder.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/core/builder.nix b/lib/core/builder.nix index 655a8f7..f52ff2a 100644 --- a/lib/core/builder.nix +++ b/lib/core/builder.nix @@ -11,13 +11,23 @@ cellsFrom, cellBlocks, transformInputs ? system: i: i, - systems ? [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ], - }: let + ... + } @ args: let + # use passed systems if any, otherwise check if inputs contains systems and + # import them, otherwise use defaults + systems = + args.systems or + ( + if builtins.hasAttr "systems" inputs + then import inputs.systems + else [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" + ] + ); + cells = res.output; loadOutputFor = system: let