From 1f5ff4384628c104500159e0621ee3fdb8d1c683 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 15 Oct 2019 11:16:11 +0800 Subject: [PATCH] artiq-full: generate DDB templates for DRTIO systems --- artiq-full.nix | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/artiq-full.nix b/artiq-full.nix index 4c0126b..57cd16a 100644 --- a/artiq-full.nix +++ b/artiq-full.nix @@ -111,9 +111,44 @@ let "; }; })) {} variants; + drtio-systems = { + af = { + master = "afmaster"; + satellites = { + "1" = "afsatellite"; + }; + }; + hust = { + master = "hustmaster"; + satellites = { + "1" = "hustsatellite"; + }; + }; + wipm5 = { + master = "wipm5master"; + satellites = { + "1" = "wipm5satellite"; + }; + }; + }; + drtio-ddbs = pkgs.lib.attrsets.mapAttrs' + (system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system) + (pkgs.stdenv.mkDerivation { + name = "device-db-\''${system}"; + buildInputs = [ artiq-fast.artiq ]; + phases = [ "buildPhase" ]; + buildPhase = " + mkdir \$out + artiq_ddb_template \ + \''${pkgs.lib.strings.concatStringsSep " " (pkgs.lib.attrsets.mapAttrsToList (dest: desc: "-s " + dest + " " + src + "/" + desc + ".json") crates.satellites) } \ + \''${src}/\''${crates.master}.json -o \$out/device_db.py + mkdir \$out/nix-support + echo file device_db_template \$out/device_db.py >> \$out/nix-support/hydra-build-products + "; + })) drtio-systems; extras = import ./extras.nix { inherit pkgs; inherit (artiq-fast) asyncserial artiq; }; in - artiq-fast // extras // generic-kasli // rec { + artiq-fast // generic-kasli // drtio-ddbs // extras // rec { artiq-board-sayma-rtm = artiq-board { target = "sayma"; variant = "rtm";