1
0
Fork 0
nix-scripts/zynq.nix

51 lines
1.5 KiB
Nix
Raw Normal View History

2020-05-03 07:45:54 +08:00
let
2020-05-03 07:49:57 +08:00
pkgs = import <nixpkgs> {};
2020-05-03 09:46:28 +08:00
zc706 = import <zc706> { mozillaOverlay = import <mozillaOverlay>; };
2020-05-03 07:49:57 +08:00
artiq-zynq = import <artiq-zynq> { mozillaOverlay = import <mozillaOverlay>; };
2020-07-04 23:56:57 +08:00
artiq-fast = import <artiq-fast> { inherit pkgs; };
2020-05-03 09:46:28 +08:00
addBuildProducts = drv: drv.overrideAttrs (oldAttrs: {
installPhase = ''
${oldAttrs.installPhase}
mkdir -p $out/nix-support
for f in $out/*.elf ; do
echo file binary-dist $f >> $out/nix-support/hydra-build-products
done
'';
});
2020-05-03 07:45:54 +08:00
in
2020-05-03 09:46:28 +08:00
(
builtins.mapAttrs (name: drv:
pkgs.lib.hydraJob (
addBuildProducts drv
)
) zc706.zc706
) // (
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiq-zynq
2020-07-04 17:27:42 +08:00
) // {
zc706-hitl-tests = pkgs.lib.hydraJob (pkgs.stdenv.mkDerivation {
name = "zc706-hitl-tests";
# requires patched Nix
__networked = true;
buildInputs = [
2020-07-04 23:56:57 +08:00
pkgs.openssh pkgs.rsync artiq-fast.artiq
2020-07-04 17:27:42 +08:00
];
phases = [ "buildPhase" ];
buildPhase =
''
2020-07-04 23:58:32 +08:00
export USER=hydra
pushd ${<artiq-zynq>}
2020-07-04 23:44:47 +08:00
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_rsa" -d ${artiq-zynq.zc706-simple-jtag}
popd
2020-07-04 17:27:42 +08:00
2020-07-04 23:56:57 +08:00
sleep 15
artiq_run --device-db ${<artiq-zynq>}/examples/device_db.py ${<artiq-zynq>}/examples/mandelbrot.py
2020-07-04 23:56:57 +08:00
2020-07-04 17:27:42 +08:00
touch $out
'';
});
}