From 70086fbfe0ab4c501f0960ea560722201dd2e5b8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 12 Sep 2021 18:57:40 +0800 Subject: [PATCH] artiq-fast: export rustPlatform --- artiq-fast/default.nix | 19 +------------------ artiq-fast/rust-platform.nix | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 artiq-fast/rust-platform.nix diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index 95ec244..dba8327 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -4,24 +4,7 @@ let artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0"; artiq7 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "7.0"; pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq7; }; - rustManifest = pkgs.fetchurl { - url = "https://static.rust-lang.org/dist/2021-01-29/channel-rust-nightly.toml"; - sha256 = "sha256-EZKgw89AH4vxaJpUHmIMzMW/80wAFQlfcxRoBD9nz0c="; - }; - - targets = []; - rustChannelOfTargets = _channel: _date: targets: - (pkgs.lib.rustLib.fromManifestFile rustManifest { - inherit (pkgs) stdenv lib fetchurl patchelf; - }).rust.override { - inherit targets; - extensions = ["rust-src"]; - }; - rust = rustChannelOfTargets "nightly" null targets; - rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform { - rustc = rust; - cargo = rust; - }); + rustPlatform = import ./rust-platform.nix { inherit pkgs; }; boards = [ { target = "kasli"; variant = "tester"; } diff --git a/artiq-fast/rust-platform.nix b/artiq-fast/rust-platform.nix new file mode 100644 index 0000000..26ccce9 --- /dev/null +++ b/artiq-fast/rust-platform.nix @@ -0,0 +1,20 @@ +{ pkgs }: +let + rustManifest = pkgs.fetchurl { + url = "https://static.rust-lang.org/dist/2021-01-29/channel-rust-nightly.toml"; + sha256 = "sha256-EZKgw89AH4vxaJpUHmIMzMW/80wAFQlfcxRoBD9nz0c="; + }; + targets = []; + rustChannelOfTargets = _channel: _date: targets: + (pkgs.lib.rustLib.fromManifestFile rustManifest { + inherit (pkgs) stdenv lib fetchurl patchelf; + }).rust.override { + inherit targets; + extensions = ["rust-src"]; + }; + rust = rustChannelOfTargets "nightly" null targets; +in + pkgs.recurseIntoAttrs (pkgs.makeRustPlatform { + rustc = rust; + cargo = rust; + })