2019-02-14 15:29:42 +08:00
|
|
|
{ pkgs ? import <nixpkgs> {}}:
|
|
|
|
let
|
2019-02-14 16:33:36 +08:00
|
|
|
artiqSrc = builtins.toString <artiqSrc>;
|
|
|
|
generatedNix = pkgs.runCommand "generated-nix" { }
|
2019-02-14 15:29:42 +08:00
|
|
|
''
|
|
|
|
cp --no-preserve=mode,ownership -R ${./artiq} $out
|
2019-02-14 16:33:36 +08:00
|
|
|
echo ${artiqSrc} > $out/pkgs/artiq-src.nix
|
2019-02-14 15:29:42 +08:00
|
|
|
'';
|
|
|
|
artiqPkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
|
|
|
|
|
|
|
|
boards = [
|
|
|
|
{ target = "kasli"; variant = "tester"; }
|
|
|
|
{ target = "kc705"; variant = "nist_clock"; }
|
|
|
|
];
|
|
|
|
boardJobs = pkgs.lib.lists.foldr (board: start:
|
|
|
|
let
|
|
|
|
boardBinaries = import "${generatedNix}/artiq-board.nix" { inherit pkgs; } {
|
|
|
|
target = board.target;
|
|
|
|
variant = board.variant;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
start // {
|
|
|
|
"artiq-board-${board.target}-${board.variant}" = boardBinaries;
|
|
|
|
"conda-artiq-board-${board.target}-${board.variant}" = import "${generatedNix}/conda-board.nix" { inherit pkgs; } {
|
2019-02-14 16:33:36 +08:00
|
|
|
artiqSrc = import "${generatedNix}/pkgs/artiq-src.nix";
|
2019-02-14 15:29:42 +08:00
|
|
|
boardBinaries = boardBinaries;
|
|
|
|
target = board.target;
|
|
|
|
variant = board.variant;
|
|
|
|
};
|
|
|
|
}) {} boards;
|
|
|
|
|
|
|
|
jobs = {
|
|
|
|
conda-artiq = import "${generatedNix}/conda-build.nix" { inherit pkgs; } {
|
|
|
|
name = "conda-artiq";
|
2019-02-14 16:33:36 +08:00
|
|
|
src = import "${generatedNix}/pkgs/artiq-src.nix";
|
2019-02-14 15:29:42 +08:00
|
|
|
recipe = "conda/artiq";
|
|
|
|
};
|
|
|
|
} // boardJobs // artiqPkgs;
|
|
|
|
in
|
|
|
|
jobs // {
|
|
|
|
channel = pkgs.releaseTools.channel {
|
|
|
|
name = "main";
|
2019-02-14 16:51:31 +08:00
|
|
|
src = "${generatedNix}";
|
2019-02-14 15:29:42 +08:00
|
|
|
constituents = builtins.attrValues jobs;
|
|
|
|
};
|
|
|
|
}
|