From 8e00904a3f90f0d30a54498b29cbffb637dde5ec Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 25 Mar 2021 23:25:53 +0100 Subject: [PATCH] ci: unified shell.nix for hardware tests --- ci/Dockerfile | 1 - ci/hardware_tests/shell.nix | 15 ++------------- ci/nixpkgs.nix | 5 ----- ci/shell.nix | 16 ++++++++++++++-- 4 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 ci/nixpkgs.nix diff --git a/ci/Dockerfile b/ci/Dockerfile index 796dcd457..471935dfa 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -36,7 +36,6 @@ ENV \ # Trezor specific stuff starts here -COPY nixpkgs.nix nixpkgs.nix COPY shell.nix shell.nix # to make multiple python versions and monero test suite available, run docker build diff --git a/ci/hardware_tests/shell.nix b/ci/hardware_tests/shell.nix index 6bdbfedb0..127e28922 100644 --- a/ci/hardware_tests/shell.nix +++ b/ci/hardware_tests/shell.nix @@ -1,14 +1,3 @@ -with import ../nixpkgs.nix; +{ fullDeps ? false }: -stdenv.mkDerivation rec { - name = "trezor-firmware-hardware-tests"; - buildInputs = [ - (callPackage ./uhubctl.nix { }) # HACK FIXME replace this with just uhubctl once pinned version of nixpkgs is updated - ffmpeg - poetry - libusb1 - dejavu_fonts - ]; - LD_LIBRARY_PATH = "${libusb1}/lib"; - NIX_ENFORCE_PURITY = 0; -} +import ../shell.nix { inherit fullDeps; hardwareTest = true; } diff --git a/ci/nixpkgs.nix b/ci/nixpkgs.nix deleted file mode 100644 index c88990e09..000000000 --- a/ci/nixpkgs.nix +++ /dev/null @@ -1,5 +0,0 @@ -# the last successful build of nixpkgs-unstable as of 2020-12-30 -import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/bea44d5ebe332260aa34a1bd48250b6364527356.tar.gz"; - sha256 = "14sfk04iyvyh3jl1s2wayw1y077dwpk2d712nhjk1wwfjkdq03r3"; -}) { } diff --git a/ci/shell.nix b/ci/shell.nix index ff851a50c..2e0f652bb 100644 --- a/ci/shell.nix +++ b/ci/shell.nix @@ -1,6 +1,14 @@ -{ fullDeps ? false }: +{ fullDeps ? false +, hardwareTest ? false + }: + +# the last successful build of nixpkgs-unstable as of 2020-12-30 +with import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/bea44d5ebe332260aa34a1bd48250b6364527356.tar.gz"; + sha256 = "14sfk04iyvyh3jl1s2wayw1y077dwpk2d712nhjk1wwfjkdq03r3"; +}) +{ }; -with import ./nixpkgs.nix; let moneroTests = fetchurl { url = "https://github.com/ph4r05/monero/releases/download/v0.17.1.9-tests/trezor_tests"; @@ -61,6 +69,10 @@ stdenv.mkDerivation ({ darwin.apple_sdk.frameworks.Metal darwin.libobjc libiconv + ] ++ lib.optionals hardwareTest [ + (callPackage ./hardware_tests/uhubctl.nix { }) # HACK FIXME replace this with just uhubctl once pinned version of nixpkgs is updated + ffmpeg + dejavu_fonts ]; LD_LIBRARY_PATH = "${libffi}/lib:${libjpeg.out}/lib:${libusb1}/lib:${libressl.out}/lib"; NIX_ENFORCE_PURITY = 0;