mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 20:40:24 +01:00
feat: replace alejandra with nixfmt(rfc-style) 1.0.0
This commit is contained in:
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
# add git hooks to format nix code before commit
|
# add git hooks to format nix code before commit
|
||||||
pre-commit-hooks = {
|
pre-commit-hooks = {
|
||||||
url = "github:cachix/pre-commit-hooks.nix";
|
url = "github:cachix/git-hooks.nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ return {
|
|||||||
formatting.shfmt, -- Shell formatter
|
formatting.shfmt, -- Shell formatter
|
||||||
formatting.terraform_fmt, -- Terraform formatter
|
formatting.terraform_fmt, -- Terraform formatter
|
||||||
formatting.stylua, -- Lua formatter
|
formatting.stylua, -- Lua formatter
|
||||||
formatting.alejandra, -- Nix formatter
|
-- formatting.alejandra, -- Nix formatter
|
||||||
formatting.sqlfluff.with { -- SQL formatter
|
formatting.sqlfluff.with { -- SQL formatter
|
||||||
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
nixd
|
nixd
|
||||||
statix # Lints and suggestions for the nix programming language
|
statix # Lints and suggestions for the nix programming language
|
||||||
deadnix # Find and remove unused code in .nix source files
|
deadnix # Find and remove unused code in .nix source files
|
||||||
alejandra # Nix Code Formatter
|
nixfmt # Nix Code Formatter
|
||||||
|
|
||||||
#-- nickel lang
|
#-- nickel lang
|
||||||
nickel
|
nickel
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ in {
|
|||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
src = mylib.relativeToRoot ".";
|
src = mylib.relativeToRoot ".";
|
||||||
hooks = {
|
hooks = {
|
||||||
alejandra.enable = true; # formatter
|
nixfmt-rfc-style = {
|
||||||
|
enable = true;
|
||||||
|
settings.width = 100;
|
||||||
|
};
|
||||||
# Source code spell checker
|
# Source code spell checker
|
||||||
typos = {
|
typos = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -139,7 +142,7 @@ in {
|
|||||||
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
|
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
|
||||||
gcc
|
gcc
|
||||||
# Nix-related
|
# Nix-related
|
||||||
alejandra
|
nixfmt
|
||||||
deadnix
|
deadnix
|
||||||
statix
|
statix
|
||||||
# spell checker
|
# spell checker
|
||||||
@@ -157,7 +160,6 @@ in {
|
|||||||
|
|
||||||
# Format the nix code in this flake
|
# Format the nix code in this flake
|
||||||
formatter = forAllSystems (
|
formatter = forAllSystems (
|
||||||
# alejandra is a nix formatter with a beautiful output
|
system: nixpkgs.legacyPackages.${system}.nixfmt
|
||||||
system: nixpkgs.legacyPackages.${system}.alejandra
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user