aboutsummaryrefslogtreecommitdiff
path: root/nix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/default.nix')
-rw-r--r--nix/default.nix60
1 files changed, 45 insertions, 15 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 2c5ac7a..eee258c 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,22 +1,52 @@
{
pkgs,
+
+ src,
+ main_pcb,
+ main_sch,
+
+ name,
+ outPath ? "share/npry/clef",
+ layers ? 2,
}: let
- panel = pkgs.callPackage ./panel.nix {};
- svgs = pkgs.callPackage ./svg.nix { inherit panel; };
- model = pkgs.callPackage ./model.nix { inherit panel; };
- fabrication = pkgs.callPackage ./fabrication.nix { inherit panel; };
+ pcb_path = main_pcb;
+ sch_path = main_sch;
+
+ pcb_args = {
+ inherit pcb_path src;
+ };
+
+ panelSrc = pkgs.callPackage ./panel.nix pcb_args;
+ panel = pkgs.callPackage ./. {
+ src = "${panelSrc}/share/npry/clef/panel";
+ main_pcb = "panel.kicad_pcb";
+
+ name = "${name}.sub.panel";
+ outPath = "${outPath}/panel";
+
+ inherit main_sch layers;
+ };
+
+ svg = pkgs.callPackage ./svg.nix (pcb_args // { nLayer = layers; });
+ model = pkgs.callPackage ./model.nix pcb_args;
+
+ fabrication = pkgs.callPackage ./fabrication.nix (pcb_args // {
+ inherit sch_path;
+ });
- full = pkgs.symlinkJoin {
- name = "ocularium";
- paths = [
- panel
- svgs
- model
- fabrication
- ];
+ schematic = pkgs.callPackage ./schematic.nix {
+ inherit sch_path src;
};
-in {
- inherit panel svgs model fabrication full;
- fab = fabrication;
+in pkgs.callPackage ./board.nix {
+ inherit
+ svg
+ model
+ fabrication
+ schematic
+ name
+ outPath
+ panel
+ panelSrc
+ ;
}