From 8ff854633991368621d061202308de2be82d9584 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 30 Nov 2020 19:41:39 +0000 Subject: [PATCH] erbium: switch to using crate2nix from upstream --- nix/pkgs/erbium/crate2nixify.nix | 44 -------------------------------- nix/pkgs/erbium/default.nix | 12 +++------ 2 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 nix/pkgs/erbium/crate2nixify.nix diff --git a/nix/pkgs/erbium/crate2nixify.nix b/nix/pkgs/erbium/crate2nixify.nix deleted file mode 100644 index 751661859b..0000000000 --- a/nix/pkgs/erbium/crate2nixify.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ depot, pkgs, lib, ... }: -{ name, src, crateName ? "", depsHash, crate2nixArgs ? {} }: -let - inherit (depot.third_party) crate2nix; - keepFiles = [ ./Cargo.toml ./Cargo.lock ]; - deps = pkgs.stdenv.mkDerivation { - inherit src; - name = "${name}-deps"; - - buildInputs = [ crate2nix ]; - - buildPhase = '' - mkdir /tmp/cargo - export CARGO_HOME=/tmp/cargo - - mkdir /tmp/gen - cp -R $src/* /tmp/gen - - cd /tmp/gen - ${crate2nix}/bin/crate2nix generate - - mkdir $out - cp /tmp/gen/Cargo.nix $out/Cargo.nix - cat >$out/default.nix < {} }: - let cargo_nix = nixpkgs.callPackage ./Cargo.nix { inherit nixpkgs; }; - in cargo_nix.${if crateName == "" then "rootCrate" else "workspaceMembers.${crateName}"}.build - EOF - ''; - - installPhase = "true"; - - outputHash = depsHash; - outputHashMode = "recursive"; - }; - merged = pkgs.runCommand "${name}-merged" { - inherit src deps; - } '' - mkdir $out - cp -R $src/* $out/ - cp $deps/default.nix $deps/Cargo.nix $out/ - ''; -in -import merged ({ nixpkgs = pkgs; } // crate2nixArgs) diff --git a/nix/pkgs/erbium/default.nix b/nix/pkgs/erbium/default.nix index bcde7950d3..40dbdfee5a 100644 --- a/nix/pkgs/erbium/default.nix +++ b/nix/pkgs/erbium/default.nix @@ -1,14 +1,10 @@ { depot, pkgs, lib, ... }@args: let - crate2nixify = import ./crate2nixify.nix args; -in -crate2nixify { - name = "erbium"; src = pkgs.fetchFromGitHub { owner = "isomer"; repo = "erbium"; - rev = "39465a183454005ca96cdf7fad8638dba192f9a2"; - hash = "sha256:10770s5bm0b0kl2q2irx78s0j5h00a8xyk1dqp9dj03vk4jbhs7q"; + rev = "aff026d4f83ff055c704508d9a146ab12c901535"; + hash = "sha256:1gn41dy8s0c8bq2dckrilf7dlc54hhq14n51nhf1rfhqrbzily3w"; }; - depsHash = "sha256:0a5bcp2jvayavia7kk8di8kdx0bdbc25p67nskypqynwgyz5ckva"; -} +in +import src