From d5334cc083e47abb3bd0301350b57ee87d3dc5b4 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 26 Sep 2019 23:34:06 +0200 Subject: [PATCH] default.nix: fix use of rustManifest part of Gitea issue #4 --- default.nix | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/default.nix b/default.nix index 0436228..3d47499 100644 --- a/default.nix +++ b/default.nix @@ -5,35 +5,32 @@ let pkgs = import { overlays = [ mozillaOverlay ]; }; -in -with pkgs; -let - rustcSrc = fetchgit { + rustcSrc = pkgs.fetchgit { url = https://github.com/rust-lang/rust.git; # master of 2019-09-25 rev = "37538aa1365d1f8a10770a7d15c95b3167c8db57"; sha256 = "1nvddkxwvrsvyx187s5mwj4fwsf26xd4vr6ba1kfy7m2fj7w79hq"; fetchSubmodules = true; }; - manifestOverlay = self: super: { - rustChannelOfTargets = _channel: _date: targets: - (super.lib.rustLib.fromManifestFile rustManifest { - inherit (super) stdenv fetchurl patchelf; - }).rust.override { inherit targets; }; - }; targets = []; + rustChannelOfTargets = _channel: _date: targets: + (pkgs.lib.rustLib.fromManifestFile rustManifest { + inherit (pkgs) stdenv fetchurl patchelf; + }).rust.override { inherit targets; }; rust = rustChannelOfTargets "nightly" null targets; - rustPlatform = recurseIntoAttrs (makeRustPlatform { + rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform { rustc = rust // { src = rustcSrc; }; cargo = rust; }); - gcc = pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc; + gcc = pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc; xbuildRustPackage = attrs: - (rustPlatform.buildRustPackage attrs) - .overrideAttrs (oldAttrs: with oldAttrs; { + let + buildPkg = rustPlatform.buildRustPackage attrs; + in + buildPkg.overrideAttrs ({ name, nativeBuildInputs, ... }: { nativeBuildInputs = - oldAttrs.nativeBuildInputs ++ [ cargo-xbuild ]; + nativeBuildInputs ++ [ pkgs.cargo-xbuild ]; buildPhase = '' cargo xbuild --release --frozen '';