dotfiles/home/common/helix.nix
chayleaf 4f531a83a9 merge into a single flake
However, Nix has some annoying store semantics when integrating with
.git repos, so I move .git to .git.bak whenever I'm not working with
git.
2023-05-25 04:39:57 +07:00

38 lines
1.2 KiB
Nix

{ config, 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; meta = pkgs.helix.meta; version = pkgs.helix.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";
};
};
}