nix-community.nixvim/flake-modules/dev/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, inputs, ... }:
{
imports =
[ ./devshell.nix ]
++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule
++ lib.optional (inputs.treefmt-nix ? flakeModule) inputs.treefmt-nix.flakeModule;
perSystem =
{
lib,
pkgs,
config,
...
}:
let
fmt = pkgs.nixfmt-rfc-style;
in
lib.optionalAttrs (inputs.treefmt-nix ? flakeModule) {
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
nixfmt = {
enable = true;
package = fmt;
};
prettier = {
enable = true;
excludes = [ "**.md" ];
};
ruff = {
check = true;
format = true;
};
statix.enable = true;
2024-07-08 16:13:45 +01:00
stylua.enable = true;
shfmt.enable = true;
2024-07-08 16:40:17 +01:00
taplo.enable = true;
};
settings = {
global.excludes = [
".envrc"
".git-blame-ignore-revs"
".gitignore"
"LICENSE"
"flake.lock"
"**.md"
"**.scm"
"**.svg"
"**/man/*.5"
];
formatter.ruff-format.options = [ "--isolated" ];
};
};
}
// lib.optionalAttrs (inputs.git-hooks ? flakeModule) {
pre-commit = {
settings.hooks = {
treefmt.enable = true;
2024-03-07 19:44:13 +01:00
typos.enable = true;
};
};
};
}