Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
nimpretty: Add nimpretty (hercules-ci#174)
Browse files Browse the repository at this point in the history
* nimpretty: Added nimpretty

* chore: executed ./example.sh
  • Loading branch information
haruki7049 committed Mar 30, 2024
1 parent c2172ef commit 1810d51
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ This repo contains a top-level `default.nix` that returns the library helper fun
* muon
* mypy
* nickel
* nimpretty
* nixfmt
* nixfmt-rfc-style
* nixpkgs-fmt
Expand Down
6 changes: 6 additions & 0 deletions examples/formatter-nimpretty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Example generated by ../examples.sh
[formatter.nimpretty]
command = "nimpretty"
excludes = []
includes = ["*.nim"]
options = []
17 changes: 17 additions & 0 deletions programs/nimpretty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, pkgs, config, ... }:
let
cfg = config.programs.nimpretty;
in
{
options.programs.nimpretty = {
enable = lib.mkEnableOption "nimpretty";
package = lib.mkPackageOption pkgs "nim" { };
};

config = lib.mkIf cfg.enable {
settings.formatter.nimpretty = {
command = "${cfg.package}/bin/nimpretty";
includes = [ "*.nim" ];
};
};
}

0 comments on commit 1810d51

Please sign in to comment.