41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
|
|
#
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
{ module-name, ... }:
|
|
{ flake-parts-lib, lib, ... }:
|
|
{
|
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
|
{ config, pkgs, ... }:
|
|
{
|
|
options.languages.${module-name}.enable = lib.mkEnableOption "Plain Text";
|
|
config = lib.mkIf config.languages.${module-name}.enable {
|
|
editors.helix.languages = {
|
|
language = [
|
|
{
|
|
name = "plain-text";
|
|
scope = "source.txt";
|
|
file-types = [ "txt" ];
|
|
language-servers = (
|
|
lib.optionals config.languages.en-us.enable [
|
|
"ltex-ls-plus"
|
|
"vale-ls"
|
|
"typos"
|
|
]
|
|
);
|
|
formatter = {
|
|
command = "${config.treefmt.build.wrapper}/bin/treefmt";
|
|
args = [
|
|
"--stdin"
|
|
"%{buffer_name}"
|
|
"--quiet"
|
|
];
|
|
};
|
|
auto-format = true;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|