Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ hooks](modules/pre-commit.nix).
- [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt)
- [statix](https://github.com/nerdypepper/statix)

### Nushell

- [nufmt](https://github.com/nushell/nufmt)

### OCaml

- [dune-fmt](https://dune.build/)
Expand Down
30 changes: 30 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,19 @@ in
};
};
};
nufmt = mkOption {
description = "nufmt hook";
type = types.submodule {
imports = [ hookModule ];
options.settings = {
configPath = mkOption {
type = types.nullOr types.path;
description = "Path to the nufmt.nuon configuration file.";
default = null;
};
};
};
};
ormolu = mkOption {
description = "ormolu hook";
type = types.submodule {
Expand Down Expand Up @@ -3648,6 +3661,22 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
in
"${hooks.no-commit-to-branch.package}/bin/no-commit-to-branch ${cmdArgs}";
};
nufmt =
{
name = "nufmt";
description = "Nushell code formatter.";
package = tools.nufmt;
entry =
let
cmdArgs =
mkCmdArgs
(with hooks.nufmt.settings; [
[ (configPath != null) "--config ${configPath}" ]
]);
in
"${lib.getExe hooks.nufmt.package} ${cmdArgs}";
types = [ "nushell" ];
};
ocp-indent =
{
name = "ocp-indent";
Expand Down Expand Up @@ -4016,6 +4045,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
[ (configuration != { }) " --config ${toml.generate ".rumdl.toml" configuration}" ]
]);
in

{
name = "rumdl";
description = "Style checker and linter for rumdl files.";
Expand Down
2 changes: 2 additions & 0 deletions nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
, nixfmt-classic ? placeholder "nixfmt-classic"
, nixfmt-rfc-style ? placeholder "nixfmt-rfc-style"
, nixpkgs-fmt
, nufmt ? placeholder "nufmt"
, nodePackages
, ocamlPackages
, opam
Expand Down Expand Up @@ -166,6 +167,7 @@ in
nil
nixf-diagnose
nixpkgs-fmt
nufmt
opam
opentofu
ormolu
Expand Down
Loading