nix-scripts/zynq.nix

50 lines
1.4 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-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 = [
pkgs.openssh pkgs.rsync
];
phases = [ "buildPhase" ];
buildPhase =
''
export HOME=`mktemp -d`
mkdir $HOME/.ssh
cp /opt/hydra_id_rsa $HOME/.ssh/id_rsa
cp /opt/hydra_id_rsa.pub $HOME/.ssh/id_rsa.pub
echo "rpi-4 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJu+HhQmQAclub9K/B3xUQ28lBg+MEdqSeBuQNZgPGKB" > $HOME/.ssh/known_hosts
chmod 600 $HOME/.ssh/id_rsa
2020-07-04 17:37:04 +08:00
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -d ${artiq-zynq.zc706-simple-jtag}
2020-07-04 17:27:42 +08:00
touch $out
'';
});
}