2019-02-15 23:18:40 +08:00
|
|
|
{ pkgs ? import <nixpkgs> {}}:
|
2019-02-15 23:06:00 +08:00
|
|
|
|
2019-02-15 23:39:57 +08:00
|
|
|
let
|
2019-02-16 00:24:20 +08:00
|
|
|
sinaraSystemsSrc = <sinaraSystemsSrc>;
|
2019-02-15 23:39:57 +08:00
|
|
|
|
2019-02-16 00:24:20 +08:00
|
|
|
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
|
|
|
''
|
|
|
|
mkdir $out
|
|
|
|
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
|
|
|
|
HASH=`nix-hash --type sha256 --base32 ${sinaraSystemsSrc}`
|
|
|
|
cat > $out/default.nix << EOF
|
|
|
|
{ pkgs ? import <nixpkgs> {}}:
|
2019-02-15 23:39:57 +08:00
|
|
|
|
2019-02-15 23:50:44 +08:00
|
|
|
let
|
2019-02-16 00:24:20 +08:00
|
|
|
target = "kasli";
|
2019-02-16 00:29:52 +08:00
|
|
|
variants = ["berkeley" "mitll2" "mitll" "nudt" "sysu" "tsinghua2" "tsinghua" "ubirmingham" "unsw" "ustc" "wipm"];
|
2019-02-16 00:24:20 +08:00
|
|
|
|
|
|
|
artiq-board = import <m-labs/artiq-board.nix> { inherit pkgs; };
|
|
|
|
conda-artiq-board = import <m-labs/conda-artiq-board.nix> { inherit pkgs; };
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "git://github.com/m-labs/sinara-systems.git";
|
|
|
|
rev = "$REV";
|
|
|
|
sha256 = "$HASH";
|
|
|
|
leaveDotGit = true;
|
2019-02-15 23:50:44 +08:00
|
|
|
};
|
2019-02-19 20:47:44 +08:00
|
|
|
generic-kasli = pkgs.lib.lists.foldr (variant: start:
|
2019-02-16 00:24:20 +08:00
|
|
|
let
|
2019-02-17 12:52:48 +08:00
|
|
|
json = builtins.toPath (src + "/\''${variant}.json");
|
2019-02-16 00:24:20 +08:00
|
|
|
boardBinaries = artiq-board {
|
|
|
|
inherit target variant;
|
|
|
|
buildCommand = "python -m artiq.gateware.targets.kasli_generic \''${json}";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
start // {
|
|
|
|
"artiq-board-\''${target}-\''${variant}" = boardBinaries;
|
|
|
|
"conda-artiq-board-\''${target}-\''${variant}" = conda-artiq-board {
|
|
|
|
boardBinaries = boardBinaries;
|
|
|
|
inherit target variant;
|
|
|
|
};
|
2019-02-19 20:47:44 +08:00
|
|
|
}) {} variants;
|
|
|
|
in
|
|
|
|
generic-kasli // {
|
|
|
|
artiq-board-sayma-satellite = artiq-board {
|
|
|
|
target = "sayma";
|
|
|
|
variant = "satellite";
|
|
|
|
buildCommand = "python -m artiq.gateware.targets.sayma_rtm && python -m artiq.gateware.targets.sayma_amc -V satellite";
|
2019-02-19 22:20:03 +08:00
|
|
|
extraInstallCommands = "cp artiq_sayma/rtm_gateware/rtm.bit $TARGET_DIR";
|
2019-02-19 20:47:44 +08:00
|
|
|
};
|
|
|
|
}
|
2019-02-16 00:24:20 +08:00
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
jobs = builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) (import generatedNix { inherit pkgs; });
|
2019-02-15 23:39:57 +08:00
|
|
|
in
|
2019-02-16 00:24:20 +08:00
|
|
|
jobs // {
|
|
|
|
channel = pkgs.releaseTools.channel {
|
|
|
|
name = "sinara-systems";
|
|
|
|
src = generatedNix;
|
|
|
|
constituents = builtins.attrValues jobs;
|
|
|
|
};
|
|
|
|
}
|