diff --git a/flake.nix b/flake.nix index 3632f207..287779de 100644 --- a/flake.nix +++ b/flake.nix @@ -89,7 +89,6 @@ { imports = [ inputs.devshell.flakeModule - inputs.flake-parts.flakeModules.easyOverlay inputs.flake-root.flakeModule inputs.treefmt-nix.flakeModule ./mkdocs.nix diff --git a/modules/default.nix b/modules/default.nix index a00b7774..6130ed1d 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,10 +1,10 @@ -{ +{self, ...}: { imports = [ ./testing.nix ]; # create a default nixos module which mixes in all modules - flake.nixosModules.default = { + flake.nixosModules.default = {pkgs, ...}: { imports = [ ./backup ./erigon @@ -18,5 +18,7 @@ ./prysm-validator ./restore ]; + + _module.args.ethereum-nix = self.packages.${pkgs.system}; }; } diff --git a/modules/mev-boost/default.nix b/modules/mev-boost/default.nix index 6a868bfe..dd44c72d 100644 --- a/modules/mev-boost/default.nix +++ b/modules/mev-boost/default.nix @@ -1,7 +1,7 @@ { config, lib, - pkgs, + ethereum-nix, ... }: let modulesLib = import ../lib.nix lib; @@ -15,7 +15,7 @@ eachMevBoost = config.services.ethereum.mev-boost; in { ###### interface - inherit (import ./options.nix {inherit lib pkgs;}) options; + inherit (import ./options.nix {inherit lib ethereum-nix;}) options; ###### implementation diff --git a/modules/mev-boost/options.nix b/modules/mev-boost/options.nix index fff0f90e..dcb4acbe 100644 --- a/modules/mev-boost/options.nix +++ b/modules/mev-boost/options.nix @@ -1,6 +1,6 @@ { lib, - pkgs, + ethereum-nix, ... }: let args = import ./args.nix lib; @@ -18,8 +18,8 @@ }; package = mkOption { - default = pkgs.mev-boost; - defaultText = literalExpression "pkgs.mev-boost"; + default = ethereum-nix.mev-boost; + defaultText = literalExpression "ethereum-nix.mev-boost"; type = types.package; description = mdDoc "Package to use for mev-boost binary"; }; diff --git a/modules/nethermind/default.nix b/modules/nethermind/default.nix index 58e1c29a..b26645e6 100644 --- a/modules/nethermind/default.nix +++ b/modules/nethermind/default.nix @@ -1,7 +1,7 @@ { config, lib, - pkgs, + ethereum-nix, ... }: let inherit @@ -34,7 +34,7 @@ eachNethermind = config.services.ethereum.nethermind; in { ###### interface - inherit (import ./options.nix {inherit lib pkgs;}) options; + inherit (import ./options.nix {inherit lib ethereum-nix;}) options; ###### implementation diff --git a/modules/nethermind/options.nix b/modules/nethermind/options.nix index 78fa8a69..764e14fc 100644 --- a/modules/nethermind/options.nix +++ b/modules/nethermind/options.nix @@ -1,6 +1,6 @@ { lib, - pkgs, + ethereum-nix, ... }: let args = import ./args.nix lib; @@ -11,7 +11,7 @@ package = mkOption { type = types.package; - default = pkgs.nethermind; + default = ethereum-nix.nethermind; defaultText = literalExpression "pkgs.nethermind"; description = mdDoc "Package to use as Nethermind."; }; diff --git a/modules/prysm-validator/default.nix b/modules/prysm-validator/default.nix index 36f20dff..80400147 100644 --- a/modules/prysm-validator/default.nix +++ b/modules/prysm-validator/default.nix @@ -1,7 +1,7 @@ { config, lib, - pkgs, + ethereum-nix, ... }: let modulesLib = import ../lib.nix lib; @@ -16,7 +16,7 @@ eachValidator = config.services.ethereum.prysm-validator; in { ###### interface - inherit (import ./options.nix {inherit lib pkgs;}) options; + inherit (import ./options.nix {inherit lib ethereum-nix;}) options; ###### implementation diff --git a/modules/prysm-validator/default.test.nix b/modules/prysm-validator/default.test.nix index c55ff478..3825ffe3 100644 --- a/modules/prysm-validator/default.test.nix +++ b/modules/prysm-validator/default.test.nix @@ -3,6 +3,7 @@ module = { pkgs, + ethereum-nix, lib, ... }: @@ -18,7 +19,7 @@ mnemonic="tooth moon mad fun romance athlete envelope next mix divert tip top symbol resemble stock family melody desk sheriff drift bargain need jaguar method" echo $mnemonic > /tmp/wallet/mnemonic.txt - ${pkgs.prysm}/bin/validator wallet create \ + ${ethereum-nix.prysm}/bin/validator wallet create \ --accept-terms-of-use \ --goerli \ --keymanager-kind="direct" \ @@ -38,7 +39,7 @@ writableStore = true; }; - environment.systemPackages = [wallet-generator pkgs.ethdo pkgs.prysm]; + environment.systemPackages = [wallet-generator ethereum-nix.ethdo ethereum-nix.prysm]; services.ethereum.prysm-validator.test = { enable = true; diff --git a/modules/prysm-validator/options.nix b/modules/prysm-validator/options.nix index 4aa637d1..f8608cf0 100644 --- a/modules/prysm-validator/options.nix +++ b/modules/prysm-validator/options.nix @@ -1,6 +1,6 @@ { lib, - pkgs, + ethereum-nix, ... }: let args = import ./args.nix lib; @@ -18,8 +18,8 @@ }; package = mkOption { - default = pkgs.prysm; - defaultText = literalExpression "pkgs.prysm"; + default = ethereum-nix.prysm; + defaultText = literalExpression "ethereum-nix.prysm"; type = types.package; description = mdDoc "Package to use for Prysm binary"; }; diff --git a/modules/testing.nix b/modules/testing.nix index 2c7cc577..149d8391 100644 --- a/modules/testing.nix +++ b/modules/testing.nix @@ -1,22 +1,14 @@ { self, - inputs, ... }: { perSystem = { lib, config, system, + pkgs, ... - }: let - # create a custom nixpkgs with our flake packages available - pkgs = import inputs.nixpkgs { - inherit system; - overlays = [ - self.overlays.default - ]; - }; - in { + }: { ######################################## ## Interface ######################################## @@ -57,8 +49,8 @@ # speed up evaluation by skipping docs defaults.documentation.enable = lib.mkDefault false; - # make self available in test modules and our custom pkgs - node.specialArgs = {inherit self pkgs;}; + # make self available in test modules + node.specialArgs = {inherit self;}; # import all of our flake nixos modules by default defaults.imports = [ diff --git a/packages/default.nix b/packages/default.nix index 860cd6ca..6392fd44 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -171,7 +171,5 @@ tx-fuzz.bin = "tx-fuzz"; zcli.bin = "zcli"; }; - - overlayAttrs = self'.packages; }; }