Skip to content

Instantly share code, notes, and snippets.

@sbourdeauducq
Created January 23, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbourdeauducq/a65bf65f803eabc7a5a9e5e2be355c68 to your computer and use it in GitHub Desktop.
Save sbourdeauducq/a65bf65f803eabc7a5a9e5e2be355c68 to your computer and use it in GitHub Desktop.
hack to build artiq firmware on nix
# 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