mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-01-30 22:57:54 +00:00
project: add codebase formatter
This commit is contained in:
parent
df62314031
commit
95da682a64
@ -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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
12
shell.nix
12
shell.nix
@ -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
3
treefmt.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[formatter.lua]
|
||||||
|
command = "stylua"
|
||||||
|
includes = [ "*.lua" ]
|
Loading…
Reference in New Issue
Block a user