flake/modules/home/terminal/development.nix
2024-09-03 14:40:28 +00:00

59 lines
1.3 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
];
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 = [
{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.nixfmt}/bin/nixfmt";
}
{
name = "rust";
auto-format = true;
formatter.command = "rustfmt";
}
];
};
};
}