flake: expose build, allow selection of output
This commit is contained in:
parent
fa1f300067
commit
01339c9e78
36
flake.nix
36
flake.nix
@ -122,7 +122,8 @@
|
|||||||
"nist_clock_satellite" "nist_qc2_satellite" "acpki_nist_clock_satellite" "acpki_nist_qc2_satellite"
|
"nist_clock_satellite" "nist_qc2_satellite" "acpki_nist_clock_satellite" "acpki_nist_qc2_satellite"
|
||||||
"nist_clock_satellite_100mhz" "nist_qc2_satellite_100mhz" "acpki_nist_clock_satellite_100mhz" "acpki_nist_qc2_satellite_100mhz"
|
"nist_clock_satellite_100mhz" "nist_qc2_satellite_100mhz" "acpki_nist_clock_satellite_100mhz" "acpki_nist_qc2_satellite_100mhz"
|
||||||
];
|
];
|
||||||
build = { target, variant, json ? null }: let
|
build = { target, variant, json ? null, output ? null }: let
|
||||||
|
# output - if null will build everything (fw, gw, jtag, sd) or can be specified to build only one
|
||||||
szl = zynqpkgs."${target}-szl";
|
szl = zynqpkgs."${target}-szl";
|
||||||
fsbl = zynqpkgs."${target}-fsbl";
|
fsbl = zynqpkgs."${target}-fsbl";
|
||||||
fwtype = if builtins.elem variant sat_variants then "satman" else "runtime";
|
fwtype = if builtins.elem variant sat_variants then "satman" else "runtime";
|
||||||
@ -235,17 +236,26 @@
|
|||||||
mkbootimage boot.bif $out/boot.bin
|
mkbootimage boot.bif $out/boot.bin
|
||||||
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
||||||
'';
|
'';
|
||||||
in {
|
in (
|
||||||
"${target}-${variant}-firmware" = firmware;
|
if output == null || output == "firmware" then {
|
||||||
"${target}-${variant}-gateware" = gateware;
|
"${target}-${variant}-firmware" = firmware;
|
||||||
"${target}-${variant}-jtag" = jtag;
|
} else {}
|
||||||
"${target}-${variant}-sd" = sd;
|
) // (
|
||||||
} // (
|
if output == null || output == "gateware" then {
|
||||||
if builtins.elem target fsblTargets
|
"${target}-${variant}-gateware" = gateware;
|
||||||
then {
|
} else {}
|
||||||
"${target}-${variant}-fsbl-sd" = fsbl-sd;
|
) // (
|
||||||
}
|
if output == null || output == "jtag" then {
|
||||||
else {}
|
"${target}-${variant}-jtag" = jtag;
|
||||||
|
} else {}
|
||||||
|
) // (
|
||||||
|
if output == null || output == "sd" then {
|
||||||
|
"${target}-${variant}-sd" = sd;
|
||||||
|
} else {}
|
||||||
|
) // (
|
||||||
|
if builtins.elem target fsblTargets && (output == null || output == "fsbl-sd") then {
|
||||||
|
"${target}-${variant}-fsbl-sd" = fsbl-sd;
|
||||||
|
} else {}
|
||||||
);
|
);
|
||||||
|
|
||||||
gateware-sim = pkgs.stdenv.mkDerivation {
|
gateware-sim = pkgs.stdenv.mkDerivation {
|
||||||
@ -374,5 +384,7 @@
|
|||||||
SZL = "${zynqpkgs.szl}";
|
SZL = "${zynqpkgs.szl}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
makeArtiqZynqPackage = build;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user