artiq-board.nix: move inputs outside inner function, accept vivado as arg to cut memory usage

This commit is contained in:
Astro 2020-06-17 22:39:41 +02:00
parent 08d28437e4
commit f1325dce29
2 changed files with 11 additions and 8 deletions

View File

@ -1,11 +1,9 @@
# Install Vivado in /opt and add to /etc/nixos/configuration.nix: # Install Vivado in /opt and add to /etc/nixos/configuration.nix:
# nix.sandboxPaths = ["/opt"]; # nix.sandboxPaths = ["/opt"];
{ pkgs }: { pkgs
{ target , vivado ? import ./vivado.nix { inherit pkgs; }
, variant }:
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""}:
let let
artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; }; artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
@ -44,11 +42,15 @@ let
''; '';
}; };
vivado = import ./vivado.nix { inherit pkgs; }; in
{ target
, variant
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""}:
# Board packages are Python modules so that they get added to the ARTIQ Python # Board packages are Python modules so that they get added to the ARTIQ Python
# environment, and artiq_flash finds them. # environment, and artiq_flash finds them.
in pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec { pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
name = "artiq-board-${target}-${variant}-${version}"; name = "artiq-board-${target}-${variant}-${version}";
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; }); version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
phases = [ "buildPhase" "installCheckPhase" "installPhase" ]; phases = [ "buildPhase" "installCheckPhase" "installPhase" ];

View File

@ -100,7 +100,8 @@ let
"uamsterdam" "uamsterdam"
]); ]);
artiq-board = import ./fast/artiq-board.nix { inherit pkgs; }; vivado = import ./fast/vivado.nix { inherit pkgs; };
artiq-board = import ./fast/artiq-board.nix { inherit pkgs vivado; };
conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; }; conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; };
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git"; url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";