diff --git a/flake.nix b/flake.nix --- a/flake.nix +++ b/flake.nix @@ -53,7 +53,7 @@ generatedPackages // defaultPackage; in { - formatter = forAllSystems (pkgs: pkgs.nixfmt-tree); + formatter = forAllSystems (pkgs: pkgs.treefmt.withConfig (import ./treefmt.nix { inherit pkgs; })); packages = forAllSystems (mkPackages true); diff --git a/selene.toml b/selene.toml --- a/selene.toml +++ b/selene.toml @@ -1,4 +1,4 @@ -std="vim" +std = "vim" [rules] mixed_table = "allow" diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,63 @@ +{ pkgs }: +{ + runtimeInputs = with pkgs; [ + # keep-sorted start + deadnix + keep-sorted + nixfmt-rfc-style + statix + stylua + taplo + # keep-sorted end + + (writeShellScriptBin "statix-fix" '' + for file in "$@"; do + ${lib.getExe statix} fix "$file" + done + '') + ]; + + settings = { + on-unmatched = "info"; + tree-root-file = "flake.nix"; + + excludes = [ + "pkgs/ivy-plugins/_sources/*" + ]; + + formatter = { + # keep-sorted start block=yes newline_separated=yes + deadnix = { + command = "deadnix"; + includes = [ "*.nix" ]; + }; + + keep-sorted = { + command = "keep-sorted"; + includes = [ "*" ]; + }; + + nixfmt = { + command = "nixfmt"; + includes = [ "*.nix" ]; + }; + + statix = { + command = "statix-fix"; + includes = [ "*.nix" ]; + }; + + stylua = { + command = "stylua"; + includes = [ "*.lua" ]; + }; + + taplo = { + command = "taplo"; + options = "format"; + includes = [ "*.toml" ]; + }; + # keep-sorted end + }; + }; +} diff --git a/pkgs/ivy/package.nix b/pkgs/ivy/package.nix --- a/pkgs/ivy/package.nix +++ b/pkgs/ivy/package.nix @@ -91,6 +91,7 @@ ]; grammarsNames = [ + # keep-sorted start "astro" "bash" "c" @@ -127,11 +128,11 @@ "json" "jsonc" "just" + "latex" "less" "lua" "luadoc" "luau" - "latex" "make" "markdown" "markdown_inline" @@ -163,6 +164,7 @@ "yaml" "yuck" "zig" + # keep-sorted end ]; in wrapNeovim {