From 0d9588545a10478363cc0ec8e211c8d1e02eaf3c Mon Sep 17 00:00:00 2001 From: Artur Cygan Date: Thu, 28 Dec 2023 23:23:44 +0100 Subject: [PATCH] Bump nixpkgs and default back to non-static (#1154) --- flake.lock | 18 +++++++++--------- flake.nix | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index 1a85b36d2..6f81b13f4 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -52,11 +52,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693780807, - "narHash": "sha256-diV1X53HjSB3fIcDFieh9tGZkJ3vqJJQhTz89NbYw60=", + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "84ef5335abf541d8148433489e0cf79affae3f89", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5bb59f09a..00f6a1464 100644 --- a/flake.nix +++ b/flake.nix @@ -15,10 +15,10 @@ outputs = { self, nixpkgs, flake-utils, nix-bundle-exe, ... }: flake-utils.lib.eachDefaultSystem (system: let - systemPkgs = nixpkgs.legacyPackages.${system}; + pkgs = nixpkgs.legacyPackages.${system}; # prefer musl on Linux, static glibc + threading does not work properly # TODO: maybe only override it for echidna-redistributable? - pkgs = if systemPkgs.stdenv.hostPlatform.isLinux then systemPkgs.pkgsMusl else systemPkgs; + pkgsStatic = if pkgs.stdenv.hostPlatform.isLinux then pkgs.pkgsMusl else pkgs; # this is not perfect for development as it hardcodes solc to 0.5.7, test suite runs fine though # would be great to integrate solc-select to be more flexible, improve this in future solc = pkgs.stdenv.mkDerivation { @@ -41,13 +41,13 @@ ''; }; - secp256k1-static = pkgs.secp256k1.overrideAttrs (attrs: { + secp256k1-static = pkgsStatic.secp256k1.overrideAttrs (attrs: { configureFlags = attrs.configureFlags ++ [ "--enable-static" ]; }); - ncurses-static = pkgs.ncurses.override { enableStatic = true; }; + ncurses-static = pkgsStatic.ncurses.override { enableStatic = true; }; - hevm = pkgs.haskell.lib.dontCheck ( + hevm = pkgs: pkgs.haskell.lib.dontCheck ( pkgs.haskellPackages.callCabal2nix "hevm" (pkgs.fetchFromGitHub { owner = "ethereum"; repo = "hevm"; @@ -57,16 +57,16 @@ # FIXME: figure out solc situation, it conflicts with the one from # solc-select that is installed with slither, disable tests in the meantime - echidna = pkgs.haskell.lib.dontCheck ( + echidna = pkgs: pkgs.haskell.lib.dontCheck ( with pkgs; lib.pipe - (haskellPackages.callCabal2nix "echidna" ./. { inherit hevm; }) + (haskellPackages.callCabal2nix "echidna" ./. { inherit (hevm pkgs); }) [ (haskell.lib.compose.addTestToolDepends [ haskellPackages.hpack slither-analyzer solc ]) (haskell.lib.compose.disableCabalFlag "static") ]); - echidna-static = with pkgs; lib.pipe - echidna + echidna-static = with pkgsStatic; lib.pipe + (echidna pkgsStatic) [ (haskell.lib.compose.appendConfigureFlags ([ @@ -130,14 +130,14 @@ ''; in rec { - packages.echidna = echidna; - packages.default = echidna; + packages.echidna = echidna pkgs; + packages.default = echidna pkgs; packages.echidna-redistributable = echidnaRedistributable; devShell = with pkgs; haskellPackages.shellFor { - packages = _: [ echidna ]; + packages = _: [ (echidna pkgs) ]; shellHook = "hpack"; buildInputs = [ solc