Created
January 23, 2019 14:01
-
-
Save sbourdeauducq/a65bf65f803eabc7a5a9e5e2be355c68 to your computer and use it in GitHub Desktop.
hack to build artiq firmware on nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run with: | |
# nix-build --option sandbox false artiq-board.nix | |
# | |
# sandbox disabling is needed by: | |
# 1) Vivado (installed in /opt, bypassing nix) - will likely keep needing it | |
# 2) cargo - can be improved after carnix becomes less buggy, or by looking into buildRustPackage | |
let | |
pkgs = import <nixpkgs> {}; | |
buildenv = import ./artiq-dev.nix { | |
extraProfile = '' | |
export HOME=`pwd` | |
''; | |
runScript = "python -m artiq.gateware.targets.kasli -V satellite"; | |
}; | |
in pkgs.stdenv.mkDerivation { | |
name = "artiq-board"; | |
src = null; | |
buildInputs = []; | |
phases = [ "buildPhase" "installPhase" ]; | |
buildPhase = buildenv + "/bin/artiq-dev"; | |
installPhase = '' | |
mkdir $out | |
cp artiq_kasli/satellite/gateware/top.bit $out | |
cp artiq_kasli/satellite/software/bootloader/bootloader.bin $out | |
cp artiq_kasli/satellite/software/satman/satman.{elf,fbi} $out | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment