2023-01-10 02:38:06 +01:00
|
|
|
{ pkgs, lib, config, paths, ... }:
|
|
|
|
let
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
# Language servers
|
|
|
|
nodePackages.typescript-language-server # typescript
|
|
|
|
nodePackages_latest.purescript-language-server # purescript
|
|
|
|
sumneko-lua-language-server # lua
|
|
|
|
rnix-lsp # nix
|
|
|
|
haskell-language-server # haskell
|
|
|
|
tectonic # something related to latex (?)
|
|
|
|
texlab # latex
|
|
|
|
nodePackages_latest.vscode-langservers-extracted
|
|
|
|
|
|
|
|
# Formatters
|
|
|
|
luaformatter # Lua
|
|
|
|
stylua # Lua
|
|
|
|
ormolu # Haskell
|
|
|
|
nodePackages_latest.purs-tidy # Purescript
|
2023-02-02 01:33:12 +01:00
|
|
|
nodePackages_latest.prettier # Js & friends
|
2023-01-10 02:38:06 +01:00
|
|
|
nodePackages_latest.prettier_d_slim # Js & friends
|
|
|
|
|
|
|
|
# Others
|
|
|
|
nodePackages.typescript # typescript
|
|
|
|
wakatime # time tracking
|
|
|
|
fd # file finder
|
|
|
|
ripgrep # Grep rewrite
|
|
|
|
update-nix-fetchgit # Useful for nix stuff
|
|
|
|
tree-sitter # Syntax highlighting
|
|
|
|
libstdcxx5 # Required by treesitter aparently
|
|
|
|
zathura # Pdf reader
|
|
|
|
xdotool # For zathura reverse search or whatever it's called
|
|
|
|
lua # For repls and whatnot
|
|
|
|
glow #Mmd preview in terminal
|
|
|
|
pandoc # Md processing
|
|
|
|
libsForQt5.falkon # Aparently needed for md preview
|
|
|
|
|
|
|
|
texlive.combined.scheme-full # Latex stuff
|
|
|
|
python38Packages.pygments # required for latex syntax highlighting
|
|
|
|
];
|
|
|
|
in
|
|
|
|
let
|
2023-01-22 01:22:38 +01:00
|
|
|
extraRuntime = env: [
|
|
|
|
# Snippets
|
2023-02-05 04:01:18 +01:00
|
|
|
(config.satellite-dev.path "dotfiles/vscode-snippets")
|
2023-01-22 01:22:38 +01:00
|
|
|
|
|
|
|
# Base16 theme
|
|
|
|
(pkgs.writeTextDir
|
|
|
|
"lua/nix/theme.lua"
|
|
|
|
''
|
|
|
|
return {
|
|
|
|
name = "${config.scheme.scheme}"
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
|
|
|
|
# Provide hints as to what app we are in
|
|
|
|
# (Useful because neovide does not provide the info itself right away)
|
|
|
|
(pkgs.writeTextDir
|
|
|
|
"lua/nix/env.lua"
|
|
|
|
"return '${env}'"
|
|
|
|
)
|
2023-01-10 02:38:06 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
# Wraps a neovim client, providing the dependencies
|
|
|
|
# and setting some flags:
|
|
|
|
#
|
|
|
|
# - NVIM_EXTRA_RUNTIME provides extra directories to add to the runtimepath.
|
|
|
|
# I cannot just install those dirs using the builtin package support because
|
|
|
|
# my package manager (lazy.nvim) disables those.
|
2023-01-12 20:49:08 +01:00
|
|
|
wrapClient = { base, name, extraArgs ? "" }:
|
2023-01-10 02:38:06 +01:00
|
|
|
pkgs.symlinkJoin {
|
|
|
|
inherit (base) name meta;
|
|
|
|
paths = [ base ];
|
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/${name} \
|
|
|
|
--prefix PATH : ${lib.makeBinPath extraPackages} \
|
2023-01-22 01:22:38 +01:00
|
|
|
--set NVIM_EXTRA_RUNTIME ${lib.strings.concatStringsSep "," (extraRuntime name)} \
|
2023-01-12 20:49:08 +01:00
|
|
|
${extraArgs}
|
2023-01-10 02:38:06 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
neovim = wrapClient { base = pkgs.neovim-nightly; name = "nvim"; };
|
2023-01-12 20:49:08 +01:00
|
|
|
neovide = wrapClient {
|
|
|
|
base = pkgs.neovide;
|
|
|
|
name = "neovide";
|
|
|
|
extraArgs = "--set NEOVIDE_MULTIGRID true";
|
|
|
|
};
|
2023-01-10 02:38:06 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# Do not manage neovim via nix
|
|
|
|
programs.neovim.enable = false;
|
|
|
|
|
2023-02-05 04:01:18 +01:00
|
|
|
home.file.".config/nvim".source = config.satellite-dev.path "dotfiles/neovim";
|
2023-01-12 20:49:08 +01:00
|
|
|
home.sessionVariables.EDITOR = "nvim";
|
|
|
|
|
2023-01-10 02:38:06 +01:00
|
|
|
home.packages = [
|
|
|
|
neovim
|
|
|
|
neovide
|
|
|
|
];
|
|
|
|
}
|