136 lines
3.0 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.settings.applications.helix;
in {
options = {
settings.applications.helix.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable helix text editor
'';
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
# Markdown
unstable.marksman
unstable.markdown-oxide
dprint
# Systemverilog
unstable.svls
# Nixos
unstable.nil
unstable.nixpkgs-fmt
# Latex
tectonic
unstable.texlab
# Vue/Nuxt
unstable.vue-language-server
unstable.typescript
];
# Markdown
home.file.".config/.dprint.json".text =''
{
"markdown": {
"lineWidth":120,
},
"excludes": [],
"plugins": [
"https://plugins.dprint.dev/markdown-0.16.1.wasm"
]
}
'';
programs.helix = {
enable = true;
package = pkgs.unstable.helix;
defaultEditor = true;
settings = {
editor.cursor-shape = {
insert = "bar";
};
};
languages = {
# Rust
language-server.rust-analyzer.config = {
cargo = {
features = "all";
};
};
language-server.vuels = {
config.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib/";
};
# Systemverilog
language-server.svls = {
command = "svls";
};
# Latex
language-server.texlab = {
config = {
texlab.chktex = {
onOpenAndSave = true;
onEdit = true;
};
texlab.forwardSearch = {
executable = "zathura";
args = [
"--synctex-forward"
"%l:%c:%f"
"%p"
];
};
texlab.build = {
auxDirectory = "build";
logDirectory = "build";
pdfDirectory = "build";
forwardSearchAfter = true;
onSave = true;
executable = "tectonic";
args = [
"-X"
"compile"
"--synctex"
"--keep-logs"
"--keep-intermediates"
"--outdir=build"
"%f"
];
};
};
};
language = [
{
name = "verilog";
language-servers = [ "svls" ];
}
{
name = "markdown";
auto-format = true;
language-servers = [ "markdown-oxide" ];
formatter.command = "dprint";
formatter.args = ["fmt" "--stdin" "md" "--config" "/home/xeovalyte/.config/.dprint.json"];
}
{
name = "typst";
auto-format = false;
formatter.command = "${pkgs.typstfmt}/bin/typstfmt";
}
];
};
};
};
}