2023-09-08 16:10:15 +02:00
|
|
|
{
|
2023-10-13 21:04:24 +02:00
|
|
|
config,
|
2023-09-08 16:10:15 +02:00
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-05-05 12:38:40 +02:00
|
|
|
}: let
|
2023-10-13 21:04:24 +02:00
|
|
|
cfg = config.myOptions.programs.helix;
|
2024-04-14 18:49:29 +02:00
|
|
|
inherit (config.myOptions.other.system) username;
|
2024-05-05 12:38:40 +02:00
|
|
|
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2023-10-13 21:04:24 +02:00
|
|
|
in {
|
2024-04-05 22:59:32 +02:00
|
|
|
options.myOptions.programs.helix.enable = mkEnableOption "helix";
|
2023-10-13 21:04:24 +02:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
nix.settings = {
|
|
|
|
substituters = [ "https://helix.cachix.org" ];
|
|
|
|
trusted-public-keys = [ "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" ];
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
2024-02-29 00:29:56 +01:00
|
|
|
home-manager.users.${username} = {
|
2023-10-13 23:11:29 +02:00
|
|
|
programs.helix = {
|
|
|
|
enable = true;
|
|
|
|
package = inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: {
|
|
|
|
makeWrapperArgs = with pkgs;
|
|
|
|
self.makeWrapperArgs
|
|
|
|
or []
|
|
|
|
++ [
|
|
|
|
"--suffix"
|
|
|
|
"PATH"
|
|
|
|
":"
|
|
|
|
(lib.makeBinPath [
|
|
|
|
rustfmt
|
|
|
|
rust-analyzer
|
|
|
|
nil
|
|
|
|
clang-tools
|
|
|
|
nodePackages.bash-language-server
|
|
|
|
nodePackages.vscode-css-languageserver-bin
|
|
|
|
nodePackages.vscode-langservers-extracted
|
|
|
|
])
|
|
|
|
];
|
|
|
|
});
|
|
|
|
settings = {
|
|
|
|
theme = "catppuccin_mocha";
|
|
|
|
editor = {
|
|
|
|
scrolloff = 7;
|
|
|
|
mouse = false;
|
|
|
|
middle-click-paste = false;
|
|
|
|
line-number = "relative";
|
|
|
|
auto-completion = false;
|
|
|
|
auto-format = false;
|
|
|
|
completion-replace = true;
|
|
|
|
true-color = true;
|
|
|
|
undercurl = true;
|
|
|
|
rulers = [ 80 ];
|
|
|
|
bufferline = "multiple";
|
|
|
|
color-modes = true;
|
|
|
|
lsp = {
|
|
|
|
display-messages = true;
|
|
|
|
display-inlay-hints = true;
|
|
|
|
};
|
|
|
|
cursor-shape = {
|
|
|
|
normal = "block";
|
|
|
|
insert = "bar";
|
|
|
|
select = "underline";
|
|
|
|
};
|
|
|
|
auto-pairs = false;
|
|
|
|
whitespace.render.newline = "all";
|
|
|
|
indent-guides.render = true;
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
2023-10-13 23:11:29 +02:00
|
|
|
languages = {
|
|
|
|
language-server = {
|
|
|
|
nil = {
|
|
|
|
command = lib.getExe pkgs.nil;
|
|
|
|
config.nil.formatting.command = [ "${lib.getExe pkgs.alejandra}" "-q" ];
|
|
|
|
};
|
|
|
|
clangd = {
|
|
|
|
command = "${pkgs.clang-tools}/bin/clangd";
|
|
|
|
clangd.fallbackFlags = [ "-std=c++2b" ];
|
|
|
|
};
|
|
|
|
vscode-css-language-server = {
|
|
|
|
command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver";
|
|
|
|
args = [ "--stdio" ];
|
|
|
|
};
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
2023-10-13 23:11:29 +02:00
|
|
|
language = [
|
|
|
|
{
|
|
|
|
name = "rust";
|
|
|
|
auto-format = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "html";
|
|
|
|
file-types = [ "html" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "c";
|
|
|
|
}
|
|
|
|
];
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|