{ pkgs, src, main_pcb, main_sch, name, outPath ? "share/npry/clef", layers ? 2, # set to a list of arguments to be passed to `kikit panelize -p` panelizeConfigs ? null, }: let pcb_path = main_pcb; sch_path = main_sch; pcb_args = { inherit pcb_path src; }; panelSrc = if panelizeConfigs != null then pkgs.callPackage ./panel.nix (pcb_args // { inherit panelizeConfigs; }) else null; panel = if panelizeConfigs != null then pkgs.callPackage ./. { src = "${panelSrc}/share/npry/clef/panel"; main_pcb = "panel.kicad_pcb"; name = "${name}.sub.panel"; outPath = "${outPath}/panel"; inherit main_sch layers; } else null; svg = pkgs.callPackage ./svg.nix (pcb_args // { nLayer = layers; }); model = pkgs.callPackage ./model.nix pcb_args; bom = pkgs.callPackage ./bom.nix pcb_args; fabrication = pkgs.callPackage ./fabrication.nix (pcb_args // { inherit sch_path; }); schematic = pkgs.callPackage ./schematic.nix { inherit sch_path src; }; in pkgs.callPackage ./board.nix { inherit svg model bom fabrication schematic name outPath panel panelSrc ; }