feat: setup pre-commit-hooks
This commit is contained in:
parent
56fd0a749e
commit
5e0b72ca74
4 changed files with 166 additions and 11 deletions
19
flake.nix
19
flake.nix
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
inputs.home-manager.url = "github:nix-community/home-manager/master";
|
||||
|
||||
inputs.nur.url = "github:nix-community/NUR/master";
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, nur }:
|
||||
inputs.pre-commit-hooks.url =
|
||||
# "github:Myhlamaeus/pre-commit-hooks.nix/feat/flake";
|
||||
"github:Myhlamaeus/pre-commit-hooks.nix/8d48a4cd434a6a6cc8f2603b50d2c0b2981a7c55";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, home-manager, nur, pre-commit-hooks }:
|
||||
let
|
||||
systemModule = { hostName, hardwareConfig, config }:
|
||||
({ pkgs, ... }: {
|
||||
|
@ -50,5 +56,14 @@
|
|||
|
||||
homeManagerModules.git = import ./home/modules/git.nix;
|
||||
|
||||
};
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pre-commit-check = pre-commit-hooks.defaultPackage.${system} {
|
||||
src = ./.;
|
||||
hooks = { nixfmt.enable = true; };
|
||||
};
|
||||
in {
|
||||
devShell = pkgs.mkShell { inherit (pre-commit-check) shellHook; };
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue