dotfiles/home/modules/helix.nix

42 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-06-29 07:45:34 +07:00
{ pkgs, lib, ... }:
2023-01-24 02:24:40 +07:00
let
wrapHelix = { extraPackages ? [ ], withPython3 ? true, extraPython3Packages ? (_: [ ]) }:
2023-01-24 02:24:40 +07:00
pkgs.symlinkJoin {
postBuild = ''
rm $out/bin/hx
2023-06-29 07:45:34 +07:00
makeWrapper ${lib.escapeShellArgs
[ "${pkgs.helix}/bin/hx" "${placeholder "out"}/bin/hx"
"--suffix" "PATH" ":" (lib.makeBinPath (extraPackages ++ [ (pkgs.python3.withPackages extraPython3Packages) ])) ]}
2023-01-24 02:24:40 +07:00
'';
buildInputs = [ pkgs.makeWrapper ]; preferLocalBuild = true;
name = "helix${pkgs.helix.version}"; paths = [ pkgs.helix ];
2023-06-29 07:45:34 +07:00
passthru.unwrapped = pkgs.helix; inherit (pkgs.helix) meta version;
2023-01-24 02:24:40 +07:00
};
in {
programs.helix = {
enable = true;
package = wrapHelix {
extraPackages = with pkgs; [
rust-analyzer
nodePackages.bash-language-server shellcheck
nodePackages.typescript-language-server
clang-tools_latest
2023-01-24 02:24:40 +07:00
nodePackages.vscode-langservers-extracted
nil
marksman
taplo
];
extraPython3Packages = (pypkgs: with pypkgs; [ python-lsp-server ]);
};
# languages = [ ];
2023-01-24 02:24:40 +07:00
settings = {
theme = "base16_terminal";
editor.cursor-shape = {
insert = "bar";
normal = "block";
select = "block";
};
2023-01-24 02:24:40 +07:00
};
};
}