From 64cb83cddb87dfe30fa95daadf84b24c29f8a9fc Mon Sep 17 00:00:00 2001 From: cy Date: Thu, 16 Jan 2025 16:56:31 -0500 Subject: [PATCH] bring back treefmt rm git-hooks --- flake.lock | 72 +++++------------------------------------------------- flake.nix | 24 ++++++++---------- 2 files changed, 16 insertions(+), 80 deletions(-) diff --git a/flake.lock b/flake.lock index 654491f..305caa0 100644 --- a/flake.lock +++ b/flake.lock @@ -80,22 +80,6 @@ } }, "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -206,34 +190,12 @@ } }, "git-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737043064, - "narHash": "sha256-I/OuxGwXwRi5gnFPsyCvVR+IfFstA+QXEpHu1hvsgD8=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "94ee657f6032d913fe0ef49adaa743804635b0bb", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "git-hooks_2": { "inputs": { "flake-compat": [ "nixvim", "flake-compat" ], - "gitignore": "gitignore_3", + "gitignore": "gitignore_2", "nixpkgs": [ "nixvim", "nixpkgs" @@ -254,27 +216,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "git-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" - } - }, - "gitignore_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -296,7 +237,7 @@ "type": "github" } }, - "gitignore_3": { + "gitignore_2": { "inputs": { "nixpkgs": [ "nixvim", @@ -390,7 +331,7 @@ "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "flake-parts": "flake-parts_2", "flake-utils": "flake-utils", "nixpkgs": [ @@ -498,9 +439,9 @@ "nixvim": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_3", - "git-hooks": "git-hooks_2", + "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", "nixpkgs": [ @@ -552,7 +493,7 @@ "lanzaboote", "flake-compat" ], - "gitignore": "gitignore_2", + "gitignore": "gitignore", "nixpkgs": [ "lanzaboote", "nixpkgs" @@ -577,7 +518,6 @@ "inputs": { "disko": "disko", "flake-parts": "flake-parts", - "git-hooks": "git-hooks", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 53aa657..3a449b9 100644 --- a/flake.nix +++ b/flake.nix @@ -28,10 +28,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; flake-parts.url = "github:hercules-ci/flake-parts"; - git-hooks = { - url = "github:cachix/git-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR }; @@ -51,7 +47,6 @@ self, nixpkgs, home-manager, - treefmt, disko, flake-parts, ... @@ -60,7 +55,7 @@ { ... }: { imports = [ - inputs.git-hooks.flakeModule + inputs.treefmt.flakeModule ]; debug = true; systems = [ @@ -68,7 +63,6 @@ ]; perSystem = { - pkgs, system, ... }: @@ -81,14 +75,16 @@ }; }; - pre-commit = { - check.enable = true; - settings.hooks = { - nixfmt-rfc-style.enable = true; - }; - }; + treefmt = { + projectRootFile = "flake.nix"; + programs.nixfmt.enable = true; + programs.stylua.enable = true; + programs.yamlfmt.enable = true; + programs.typos.enable = true; + programs.shellcheck.enable = true; - formatter = pkgs.nixfmt-rfc-style; + settings.global.excludes = [ "secrets/*" ]; + }; }; flake = {