From 2336e109934849c450d9e362b019840e26557abf Mon Sep 17 00:00:00 2001 From: Martin Nikov Date: Fri, 20 Dec 2024 17:28:38 +0200 Subject: [PATCH] refactor(packages): Move checks in different folder --- checks/default.nix | 64 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 1 + packages/default.nix | 36 ------------------------- 3 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 checks/default.nix diff --git a/checks/default.nix b/checks/default.nix new file mode 100644 index 00000000..39489c0d --- /dev/null +++ b/checks/default.nix @@ -0,0 +1,64 @@ +{ + lib, + inputs, + ... +}: +{ + perSystem = + { + inputs', + self', + pkgs, + ... + }: + let + inherit (lib) optionalAttrs; + inherit (pkgs) system; + inherit (pkgs.hostPlatform) isLinux; + in + rec { + checks = + self'.packages + // { + inherit (self'.legacyPackages) rustToolchain; + inherit (self'.legacyPackages.inputs.dlang-nix) dub; + inherit (self'.legacyPackages.inputs.nixpkgs) + cachix + nix + nix-eval-jobs + nix-fast-build + ; + inherit (self'.legacyPackages.inputs.ethereum-nix) foundry; + + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ../.; + hooks = { + nixfmt-rfc-style.enable = true; + }; + }; + } + // optionalAttrs (system == "x86_64-linux" || system == "aarch64-darwin") { + inherit (self'.legacyPackages.inputs.ethereum-nix) geth; + } + // optionalAttrs isLinux { + inherit (inputs'.validator-ejector.packages) validator-ejector; + } + // optionalAttrs (system == "x86_64-linux") { + inherit (pkgs) terraform; + inherit (self'.legacyPackages.inputs.terranix) terranix; + inherit (self'.legacyPackages.inputs.dlang-nix) + dcd + dscanner + serve-d + dmd + ldc + ; + inherit (self'.legacyPackages.inputs.ethereum-nix) + mev-boost + nethermind + web3signer + nimbus-eth2 + ; + }; + }; +} diff --git a/flake.nix b/flake.nix index bf61a9a5..b4618a15 100644 --- a/flake.nix +++ b/flake.nix @@ -222,6 +222,7 @@ in flake-parts.lib.mkFlake { inherit inputs; } { imports = [ + ./checks ./modules ./packages ]; diff --git a/packages/default.nix b/packages/default.nix index 14ab3ae6..41543953 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -72,41 +72,5 @@ inherit (legacyPackages.inputs.nixpkgs) cachix nix nix-eval-jobs; }; }; - checks = - packages - // { - inherit (legacyPackages) rustToolchain; - inherit (legacyPackages.inputs.dlang-nix) dub; - inherit (legacyPackages.inputs.nixpkgs) - cachix - nix - nix-eval-jobs - nix-fast-build - ; - inherit (legacyPackages.inputs.ethereum-nix) foundry; - } - // optionalAttrs (system == "x86_64-linux" || system == "aarch64-darwin") { - inherit (legacyPackages.inputs.ethereum-nix) geth; - } - // optionalAttrs isLinux { - inherit (inputs'.validator-ejector.packages) validator-ejector; - } - // optionalAttrs (system == "x86_64-linux") { - inherit (pkgs) terraform; - inherit (legacyPackages.inputs.terranix) terranix; - inherit (legacyPackages.inputs.dlang-nix) - dcd - dscanner - serve-d - dmd - ldc - ; - inherit (legacyPackages.inputs.ethereum-nix) - mev-boost - nethermind - web3signer - nimbus-eth2 - ; - }; }; }