project: add codebase formatter

This commit is contained in:
Gabriel Arazas 2023-03-22 19:16:57 +08:00
parent df62314031
commit 95da682a64
3 changed files with 21 additions and 3 deletions

View File

@ -8,8 +8,13 @@
outputs = inputs@{ self, nixpkgs, ... }: outputs = inputs@{ self, nixpkgs, ... }:
let systems = inputs.flake-utils.lib.defaultSystems; let systems = inputs.flake-utils.lib.defaultSystems;
in inputs.flake-utils.lib.eachSystem systems (system: { in inputs.flake-utils.lib.eachSystem systems (system: let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = devShell =
import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; import ./shell.nix { inherit pkgs; };
formatter = pkgs.treefmt;
}); });
} }

View File

@ -16,7 +16,17 @@ with pkgs;
mkShell { mkShell {
packages = [ packages = [
python3 python3
pyright
stow stow
# Language servers for...
lua-language-server # ...Lua.
pyright # ...Python.
rnix-lsp # ...Nix.
# Formatters for...
treefmt # ...everything under the sun.
stylua # ...Lua.
nixpkgs-fmt # ...Nix.
black # ...Python.
]; ];
} }

3
treefmt.toml Normal file
View File

@ -0,0 +1,3 @@
[formatter.lua]
command = "stylua"
includes = [ "*.lua" ]