dotfiles/nixos/home-manager/programs/helix.nix
2023-08-26 20:44:53 +01:00

56 lines
1.2 KiB
Nix

{
lib,
inputs,
system,
...
}: let
alejandra = lib.getExe inputs.alejandra.packages.${system}.default;
nil = lib.getExe inputs.nil.packages.${system}.default;
helixPackage = inputs.helix.packages.${system}.default;
helix = lib.getExe helixPackage;
in {
home.sessionVariables = {
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
};
programs.zsh.sessionVariables = {
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
};
systemd.user.sessionVariables = {
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
};
programs.helix = {
enable = true;
package = helixPackage;
languages = {
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
formatter = {
command = alejandra;
args = ["-q"];
};
}
];
language-server.nil = {
command = nil;
};
};
settings = {
theme = "solarized_dark";
editor = {
auto-save = true;
auto-pairs = false;
file-picker.hidden = false;
lsp.display-messages = true;
line-number = "relative";
soft-wrap.enable = true;
};
};
};
}