From 7a83d0cea03648bd6cefc46f454f1166773aa87f Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 20 Aug 2024 01:47:03 -0400 Subject: [PATCH] ci(nix): drop pre-commit-hooks Signed-off-by: seth --- flake.lock | 51 +-------------------------------------------------- flake.nix | 38 ++++++++++++++++++++++---------------- nix/dev.nix | 36 ++---------------------------------- 3 files changed, 25 insertions(+), 100 deletions(-) diff --git a/flake.lock b/flake.lock index 77e707692..3e9cd8e42 100644 --- a/flake.lock +++ b/flake.lock @@ -36,27 +36,6 @@ "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "libnbtplusplus": { "flake": false, "locked": { @@ -89,40 +68,12 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": [ - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1723803910, - "narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "flake-compat": "flake-compat", "flake-parts": "flake-parts", "libnbtplusplus": "libnbtplusplus", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 1e3e36d66..d64874e30 100644 --- a/flake.nix +++ b/flake.nix @@ -12,30 +12,36 @@ url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - nixpkgs-stable.follows = "nixpkgs"; - flake-compat.follows = "flake-compat"; - }; - }; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; libnbtplusplus = { url = "github:PrismLauncher/libnbtplusplus"; flake = false; }; + + /* + Inputs below this are optional and can be removed + + ``` + { + inputs.prismlauncher = { + url = "github:PrismLauncher/PrismLauncher"; + inputs = { + flake-compat.follows = ""; + }; + }; + } + ``` + */ + + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; }; outputs = - { flake-parts, pre-commit-hooks, ... }@inputs: - flake-parts.lib.mkFlake { inherit inputs; } { + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { imports = [ - pre-commit-hooks.flakeModule - ./nix/dev.nix ./nix/distribution.nix ]; diff --git a/nix/dev.nix b/nix/dev.nix index 2ae3c845b..32b1bd92b 100644 --- a/nix/dev.nix +++ b/nix/dev.nix @@ -1,41 +1,9 @@ { perSystem = + { pkgs, self', ... }: { - config, - lib, - pkgs, - ... - }: - { - pre-commit.settings = { - hooks = { - markdownlint.enable = true; - - deadnix.enable = true; - nil.enable = true; - nixfmt.enable = true; - - clang-format = { - enable = true; - types_or = [ - "c" - "c++" - "java" - "json" - "objective-c" - ]; - }; - }; - - tools.clang-tools = lib.mkForce pkgs.clang-tools_18; - }; - devShells.default = pkgs.mkShell { - shellHook = '' - ${config.pre-commit.installationScript} - ''; - - inputsFrom = [ config.packages.prismlauncher-unwrapped ]; + inputsFrom = [ self'.packages.prismlauncher-unwrapped ]; buildInputs = with pkgs; [ ccache ninja