diff --git a/README.md b/README.md index 7f269b1..1b7ca90 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Laptop configuration -This repository has the Nix home-manager configuration for my laptop, allowing me to manage a user configuration with reproducibility on other machines. It currently operates on a foreign Linux distribution (Fedora Asahi Remix) with plans to switch to NixOS when time allows and to make it reusable for other systems. It uses `direnv` to automatically load the environment for running commands for this Flake. +This repository has the Nix home-manager configuration for my laptop, allowing me to manage a user configuration with reproducibility on other machines. It currently operates on a foreign Linux distribution (Fedora Asahi Remix) with plans to switch to NixOS when time allows and to make it reusable for other systems. `direnv` automatically loads the environment for running commands for this Flake. ## Features diff --git a/flake.nix b/flake.nix index 6924f40..abe17c4 100644 --- a/flake.nix +++ b/flake.nix @@ -175,7 +175,15 @@ }; # https://flake.parts/options/git-hooks-nix.html pre-commit.settings = { - hooks = preCommitHooks; + hooks = preCommitHooks // { + treefmt = { + enable = true; + package = treefmt; + }; + check-merge-conflicts.enable = true; + check-symlinks.enable = true; + flake-checker.enable = true; + }; }; # https://flake.parts/options/treefmt-nix.html treefmt = { diff --git a/languages/en-us.nix b/languages/en-us.nix index fc8a6fa..13ee992 100644 --- a/languages/en-us.nix +++ b/languages/en-us.nix @@ -35,10 +35,20 @@ in # https://writewithharper.com/docs/integrations/language-server#Supported-Languages harper-ls.command = "${pkgs.harper}/bin/harper-ls"; }; + pre-commit = { + typos = { + enable = true; + settings = { + configPath = typosConfigFile.outPath; + locale = "en-us"; + }; + }; + vale.enable = true; + }; treefmt.programs.typos = { enable = true; - locale = "en-us"; configFile = typosConfigFile.outPath; + locale = "en-us"; }; devshell = { commands = [ diff --git a/languages/toml.nix b/languages/toml.nix index 9a059a1..d18bd35 100644 --- a/languages/toml.nix +++ b/languages/toml.nix @@ -20,4 +20,5 @@ language-server.taplo.command = "${pkgs.taplo}/bin/taplo"; }; treefmt.programs.taplo.enable = true; + pre-commit.check-toml.enable = true; } diff --git a/languages/yaml.nix b/languages/yaml.nix index 75c306b..1a820ae 100644 --- a/languages/yaml.nix +++ b/languages/yaml.nix @@ -23,4 +23,8 @@ enable = true; settings.plugins = [ "g-plane-pretty_yaml" ]; }; + pre-commit = { + check-yaml.enable = true; + sort-simple-yaml.enable = true; + }; }