Skip to content

Commit

Permalink
feat: add gleam (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
anntnzrb authored Jul 30, 2024
1 parent 8db8970 commit 768acdb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ functions.
* fourmolu
* fprettify
* gdformat
* gleam
* gofmt
* gofumpt
* google-java-format
Expand Down
6 changes: 6 additions & 0 deletions examples/formatter-gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Example generated by ../examples.sh
[formatter.gleam]
command = "gleam"
excludes = []
includes = ["*.gleam"]
options = ["format"]
20 changes: 20 additions & 0 deletions programs/gleam.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ lib, pkgs, config, ... }:
let
cfg = config.programs.gleam;
in
{
meta.maintainers = [ "anntnzrb" ];

options.programs.gleam = {
enable = lib.mkEnableOption "gleam";
package = lib.mkPackageOption pkgs "gleam" { };
};

config = lib.mkIf cfg.enable {
settings.formatter.gleam = {
command = cfg.package;
options = [ "format" ];
includes = [ "*.gleam" ];
};
};
}

0 comments on commit 768acdb

Please sign in to comment.