43 lines
1.2 KiB
Nix
43 lines
1.2 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 "Nix";
|
|
config = lib.mkIf config.languages.${module-name}.enable {
|
|
editors.helix.languages = {
|
|
language = [
|
|
{
|
|
name = "nix";
|
|
language-servers =
|
|
[ "nil" ]
|
|
++ (lib.optionals config.languages.en-us.enable [
|
|
"harper-ls"
|
|
"typos"
|
|
]);
|
|
formatter = {
|
|
command = "${config.treefmt.build.wrapper}/bin/treefmt";
|
|
args = [
|
|
"--stdin"
|
|
"%{buffer_name}"
|
|
"--quiet"
|
|
];
|
|
};
|
|
auto-format = true;
|
|
}
|
|
];
|
|
language-server.nil.command = "${pkgs.nil}/bin/nil";
|
|
};
|
|
treefmt.programs.nixfmt = {
|
|
enable = true;
|
|
strict = true;
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|