diff --git a/flake.nix b/flake.nix index 23f86b6..faf374a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,8 +8,13 @@ outputs = inputs@{ self, nixpkgs, ... }: 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 = - import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; + import ./shell.nix { inherit pkgs; }; + + formatter = pkgs.treefmt; }); } diff --git a/shell.nix b/shell.nix index e5f13c2..1d94038 100644 --- a/shell.nix +++ b/shell.nix @@ -16,7 +16,17 @@ with pkgs; mkShell { packages = [ python3 - pyright 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. ]; } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..06a5cc9 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,3 @@ +[formatter.lua] +command = "stylua" +includes = [ "*.lua" ]