dotfiles/nixos/home-manager/programs/helix.nix

61 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2022-12-19 09:04:27 +00:00
{
lib,
inputs,
system,
...
}: let
alejandra = lib.getExe inputs.alejandra.packages.${system}.default;
nil = lib.getExe inputs.nil.packages.${system}.default;
2023-08-26 20:42:12 +01:00
helixPackage = inputs.helix.packages.${system}.default;
helix = lib.getExe helixPackage;
2022-12-19 09:04:27 +00:00
in {
2023-08-13 17:00:41 +01:00
home.sessionVariables = {
2023-08-26 20:42:12 +01:00
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
2023-08-13 17:00:41 +01:00
};
programs.zsh.sessionVariables = {
2023-08-26 20:42:12 +01:00
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
2023-08-13 17:00:41 +01:00
};
systemd.user.sessionVariables = {
2023-08-26 20:42:12 +01:00
EDITOR = lib.mkForce helix;
VISUAL = lib.mkForce helix;
2023-08-13 17:00:41 +01:00
};
2023-07-01 08:49:46 +01:00
2022-12-07 23:52:15 +00:00
programs.helix = {
enable = true;
2023-08-26 20:42:12 +01:00
package = helixPackage;
languages = {
2023-08-26 20:42:12 +01:00
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
formatter = {
command = alejandra;
args = ["-q"];
};
}
];
language-server.nil = {
command = nil;
2023-09-09 17:16:04 +01:00
config.nil.nix = {
maxMemoryMB = 8192;
flake.autoEvalInputs = true;
};
};
};
2022-12-19 09:04:27 +00:00
settings = {
2023-08-19 11:53:48 +01:00
theme = "solarized_dark";
2022-12-19 09:29:34 +00:00
editor = {
2023-08-18 16:25:30 +01:00
auto-save = true;
2022-12-19 09:29:34 +00:00
auto-pairs = false;
2022-12-19 11:29:20 +00:00
file-picker.hidden = false;
2022-12-19 09:29:34 +00:00
lsp.display-messages = true;
line-number = "relative";
2023-08-18 22:12:43 +01:00
soft-wrap.enable = true;
2022-12-19 09:29:34 +00:00
};
2022-12-19 11:29:20 +00:00
};
2022-12-07 23:52:15 +00:00
};
}