diff --git a/.travis.yml b/.travis.yml index 13ca60c..2006734 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ env: jobs: - TestModules=1 STABLE=1 - PKG=hwi STABLE=1 + - PKG=hwi STABLE=0 - PKG=lightning-charge STABLE=1 - PKG=lightning-charge STABLE=0 - PKG=nanopos STABLE=1 @@ -29,8 +30,7 @@ env: - PKG=elementsd STABLE=1 - PKG=elementsd STABLE=0 - PKG=electrs STABLE=1 - # broken - # - PKG=electrs STABLE=0 + - PKG=electrs STABLE=0 - PKG=liquid-swap STABLE=1 - PKG=nixops19_09 STABLE=1 script: diff --git a/pkgs/electrs/default.nix b/pkgs/electrs/default.nix index 05202cb..e29efd6 100644 --- a/pkgs/electrs/default.nix +++ b/pkgs/electrs/default.nix @@ -13,8 +13,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ llvmPackages.clang ]; LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; - cargoSha256 = if pkgs ? cargo-vendor then - # nixpkgs ≤ 19.09 + cargoSha256 = if builtins.pathExists "${pkgs.path}/pkgs/build-support/rust/fetchcargo.nix" then + # nixpkgs ≤ 20.03 "19qs8if8fmygv6j74s6iwzm534fybwasjvmzdqcl996xhg75w6gi" else # for recent nixpkgs with cargo-native vendoring (introduced in nixpkgs PR #69274) diff --git a/pkgs/hwi/default.nix b/pkgs/hwi/default.nix index 9377158..41ec2d5 100644 --- a/pkgs/hwi/default.nix +++ b/pkgs/hwi/default.nix @@ -1,12 +1,18 @@ { stdenv, fetchurl, fetchFromGitHub, python3 }: with stdenv.lib; -with python3.pkgs; let - buildInputs = [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ]; + python = python3.override { + packageOverrides = self: super: { + # HWI requires mnemonic <0.19 but nixpkgs has a newer version + mnemonic = self.callPackage ./mnemonic {}; + # HWI requires ecdsa <0.14 but nixpkgs has a newer version + ecdsa = self.callPackage ./ecdsa {}; + }; + }; in -buildPythonPackage rec { +python.pkgs.buildPythonPackage rec { pname = "hwi"; version = "1.0.3"; @@ -20,8 +26,7 @@ buildPythonPackage rec { # TODO: enable tests doCheck = false; - inherit buildInputs; - propagatedBuildInputs = buildInputs; + propagatedBuildInputs = with python.pkgs; [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ]; meta = with lib; { homepage = https://github.com/bitcoin-core/hwi; diff --git a/pkgs/hwi/ecdsa/default.nix b/pkgs/hwi/ecdsa/default.nix new file mode 100644 index 0000000..d9c43f5 --- /dev/null +++ b/pkgs/hwi/ecdsa/default.nix @@ -0,0 +1,28 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pkgs +, six +}: + +buildPythonPackage rec { + pname = "ecdsa"; + version = "0.13.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "163c80b064a763ea733870feb96f9dd9b92216cfcacd374837af18e4e8ec3d4d"; + }; + + propagatedBuildInputs = [ six ]; + # Only needed for tests + checkInputs = [ pkgs.openssl ]; + + meta = with stdenv.lib; { + description = "ECDSA cryptographic signature library"; + homepage = "https://github.com/warner/python-ecdsa"; + license = licenses.mit; + maintainers = with maintainers; [ aszlig ]; + }; + +} diff --git a/pkgs/hwi/mnemonic/default.nix b/pkgs/hwi/mnemonic/default.nix new file mode 100644 index 0000000..4cb416a --- /dev/null +++ b/pkgs/hwi/mnemonic/default.nix @@ -0,0 +1,20 @@ +{ lib, fetchPypi, buildPythonPackage, pbkdf2 }: + +buildPythonPackage rec { + pname = "mnemonic"; + version = "0.18"; + + src = fetchPypi { + inherit pname version; + sha256 = "02a7306a792370f4a0c106c2cf1ce5a0c84b9dbd7e71c6792fdb9ad88a727f1d"; + }; + + propagatedBuildInputs = [ pbkdf2 ]; + + meta = { + description = "Implementation of Bitcoin BIP-0039"; + homepage = "https://github.com/trezor/python-mnemonic"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ np ]; + }; +} diff --git a/pkgs/nixops/release.nix.patch b/pkgs/nixops/release.nix.patch index 734159b..940073e 100644 --- a/pkgs/nixops/release.nix.patch +++ b/pkgs/nixops/release.nix.patch @@ -43,7 +43,6 @@ ('destDir', 'string'), ('user', 'string'), ('group', 'string'), - --- a/nixops/ssh_util.py +++ b/nixops/ssh_util.py @@ -278,6 +278,7 @@ class SSH(object): @@ -54,3 +53,15 @@ master = self.get_master(flags, timeout, user) flags = flags + self._get_flags() if logged: + +--- a/nixops/deployment.py ++++ b/nixops/deployment.py +@@ -748,6 +748,6 @@ + if res == 100 or force_reboot or m.state == m.RESCUE: + if not allow_reboot and not force_reboot: + raise Exception("the new configuration requires a " +- "reboot to take effect (hint: use " ++ "reboot of '{}' to take effect (hint: use " + "‘--allow-reboot’)".format(m.name)) + m.reboot_sync() + res = 0 \ No newline at end of file diff --git a/pkgs/nixpkgs-pinned.nix b/pkgs/nixpkgs-pinned.nix index 40b07a2..9cbcadb 100644 --- a/pkgs/nixpkgs-pinned.nix +++ b/pkgs/nixpkgs-pinned.nix @@ -8,11 +8,11 @@ in { # To update, run ../helper/fetch-channel REV nixpkgs = fetch { - rev = "839cd8d03aa55f067e23a64097fc5b7d7e02f468"; - sha256 = "1w0xklkk9lbwvrx02gng71pyf476h223098692pji5wg5l0sgm02"; + rev = "95b9c99f6d091273572ff1ec62b97b6ad3f68bdf"; + sha256 = "1qcwr9binkwfayix88aljwssxi5djkwscx0rnwlk1yp9q60rgp3d"; }; nixpkgs-unstable = fetch { - rev = "7c2fc1ce23a805f3220d867f528ceb9bd848d2e1"; - sha256 = "1g562hlp5ha11a41daav9bnq86n4nmbm3xzhpzmma8c4jn4k2p8y"; + rev = "22a3bf9fb9edad917fb6cd1066d58b5e426ee975"; + sha256 = "089hqg2r2ar5piw9q5z3iv0qbmfjc4rl5wkx9z16aqnlras72zsa"; }; } diff --git a/test/make-test.nix b/test/make-test.nix index d20ed94..860751a 100644 --- a/test/make-test.nix +++ b/test/make-test.nix @@ -1,25 +1,17 @@ testArgs: let - stablePkgs = import { config = {}; overlays = []; }; - unstable = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs-unstable; + pkgs = import { config = {}; overlays = []; }; - # Stable nixpkgs doesn't yet include the Python testing framework. - # Use unstable nixpkgs and patch it so that it uses stable nixpkgs for the VM - # machine configuration. - testingPkgs = - stablePkgs.runCommand "nixpkgs-testing" {} '' - cp -r ${unstable} $out - cd $out - chmod +w -R . - patch -p1 < ${./use-stable-pkgs.patch} - ''; + pkgs19_09 = import (pkgs.fetchzip { + url = "https://github.com/NixOS/nixpkgs-channels/archive/a7ceb2536ab11973c59750c4c48994e3064a75fa.tar.gz"; + sha256 = "0hka65f31njqpq7i07l22z5rs7lkdfcl4pbqlmlsvnysb74ynyg1"; + }) { config = {}; overlays = []; }; - test = (import "${testingPkgs}/nixos/tests/make-test-python.nix") testArgs; + test = (import "${pkgs.path}/nixos/tests/make-test-python.nix") testArgs; fixedTest = { system ? builtins.currentSystem, ... }@args: let - pkgs = (import testingPkgs { inherit system; config = {}; overlays = []; } ); pkgsFixed = pkgs // { # Fix the black Python code formatter that's used in the test to allow the test # script to have longer lines. The default width of 88 chars is too restrictive for @@ -35,7 +27,7 @@ let # QEMU 4.20 from unstable fails on Travis build nodes with message # "error: failed to set MSR 0x48b to 0x159ff00000000" # Use version 4.0.1 instead. - inherit (stablePkgs) qemu_test; + inherit (pkgs19_09) qemu_test; }; in test (args // { pkgs = pkgsFixed; }); diff --git a/test/use-stable-pkgs.patch b/test/use-stable-pkgs.patch deleted file mode 100644 index 1a9f0b3..0000000 --- a/test/use-stable-pkgs.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/nixos/lib/build-vms.nix -+++ b/nixos/lib/build-vms.nix -@@ -30,10 +30,10 @@ rec { - buildVM = - nodes: configurations: - -- import ./eval-config.nix { -+ import { - inherit system; - modules = configurations ++ extraConfigurations; -- baseModules = (import ../modules/module-list.nix) ++ -+ baseModules = (import ) ++ - [ ../modules/virtualisation/qemu-vm.nix - ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs - { key = "no-manual"; documentation.nixos.enable = false; } - - -services.connman doesn't exist in stable nixpkgs ---- a/nixos/modules/virtualisation/qemu-vm.nix -+++ b/nixos/modules/virtualisation/qemu-vm.nix -@@ -620,7 +620,6 @@ in - - # Wireless won't work in the VM. - networking.wireless.enable = mkVMOverride false; -- services.connman.enable = mkVMOverride false; - - # Speed up booting by not waiting for ARP. - networking.dhcpcd.extraConfig = "noarp";