dotfiles/home/common/helix.nix

42 lines
1.2 KiB
Nix

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