Skip to content

Commit

Permalink
feat(flake.nix): update to treefmt2 and add formatting check
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rodrigues <[email protected]>
  • Loading branch information
SigmaSquadron committed Oct 19, 2024
1 parent cf5d677 commit 03b7199
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 32 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,40 @@
home-manager-module = inputs.home-manager.nixosModules.home-manager;
plasma-module = self.homeManagerModules.plasma-manager;
};
formatting =
nixpkgsFor.${system}.runCommandLocal "fmt-check"
{
nativeBuildInputs = with nixpkgsFor.${system}; [
treefmt2

deadnix
nixfmt-rfc-style
nodePackages.prettier
ruby
ruby.devdoc
rufo
shellcheck
shfmt
taplo
(pkgs.writeShellScriptBin "statix-fix" ''
for file in "''$@"; do
${lib.getExe statix} fix "$file"
done
'')
(python3.withPackages (pyPkgs: [
pyPkgs.python-lsp-server
pyPkgs.black
pyPkgs.isort
]))
];
}
''
treefmt --ci
touch "$out"
'';
});

formatter = forAllSystems (system: nixpkgsFor.${system}.treefmt);
formatter = forAllSystems (system: nixpkgsFor.${system}.treefmt2);

devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.mkShell {
Expand Down

0 comments on commit 03b7199

Please sign in to comment.