flake/modules/home/terminal/development.nix
2024-09-05 12:01:05 +00:00

70 lines
1.5 KiB
Nix

{ pkgs, lib, config, ... }: {
options.mods.terminal.development.enable =
lib.mkEnableOption "enables cli editor";
config = lib.mkIf config.mods.terminal.development.enable {
home.packages = with pkgs; [
# Nix
nil
# Rust
rust-analyzer
lldb_18
# GLSL
glsl_analyzer
];
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
home.sessionVariables.EDITOR = "hx";
programs.zsh.sessionVariables.EDITOR = "hx";
programs.helix = {
enable = true;
settings = {
keys.normal = {
"esc" = [ "collapse_selection" "keep_primary_selection" ];
};
editor = {
line-number = "relative";
completion-replace = true;
bufferline = "always";
rulers = [ 80 ];
soft-wrap.enable = true;
indent-guides.render = true;
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
};
};
languages.language-server = {
glsl.command = "${pkgs.glsl_analyzer}/bin/glsl_analyzer";
};
languages.language = [
{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.nixfmt}/bin/nixfmt";
}
{
name = "rust";
auto-format = true;
formatter.command = "rustfmt";
}
{
name = "glsl";
language-servers = [ "glsl" ];
}
];
};
};
}