🎨 add pre-commit-hooks and cleanup
This commit is contained in:
29
flake.nix
29
flake.nix
@ -4,11 +4,18 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, flake-utils, ... }:
|
||||
outputs = { self, nixpkgs, home-manager, flake-utils, pre-commit-hooks, ... }:
|
||||
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]
|
||||
(system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
@ -28,12 +35,28 @@
|
||||
packages.default =
|
||||
self.homeConfigurations.${system}.walkah.activationPackage;
|
||||
|
||||
checks = {
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
deadnix.enable = true;
|
||||
nixpkgs-fmt.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "dotfiles";
|
||||
buildInputs = with pkgs; [
|
||||
deadnix
|
||||
nil
|
||||
nixpkgs-fmt
|
||||
statix
|
||||
];
|
||||
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user