refactored

This commit is contained in:
alsaiduq-lab 2025-06-30 13:23:10 -06:00
parent 2955bcfd0c
commit de4b14a35d

View file

@ -1,72 +1,38 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: let
gitDir = "${pkgs.git}/bin/git";
nvim = "${config.home.homeDirectory}/.config/nvim";
in {
programs.neovim = {
enable = true;
extraPython3Packages = ps: [ps.pynvim];
};
home.packages = with pkgs; [ home.packages = with pkgs; [
neovim
gnugrep
git git
luajit luajit
luaPackages.luarocks luaPackages.luarocks
gopls
haskell-language-server
jdt-language-server
clang-tools
vscode-langservers-extracted
marksman
nil
taplo
yaml-language-server
sqls
alejandra
stylua
shfmt
yamlfmt
luaPackages.luacheck
yamllint
hadolint
shellcheck
cppcheck
rubocop
phpPackages.php-codesniffer
phpPackages.phpstan
checkstyle
tflint
sqlfluff
tree-sitter tree-sitter
luajitPackages.jsregexp
jq
curl
unzip
]; ];
home.sessionVariables = { home.sessionPath = ["$HOME/.local/share/nvim/mason/bin"];
LUA_PATH = "${pkgs.luajit}/share/lua/5.1/?.lua;${pkgs.luajit}/share/lua/5.1/?/init.lua;;";
LUA_CPATH = "${pkgs.luajit}/lib/lua/5.1/?.so;;";
};
home.sessionPath = [ home.activation.nvimConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
"$HOME/.local/share/nvim/mason/bin" if [ ! -d "${nvim}/.git" ]; then
]; ${gitDir} clone --depth 1 \
https://github.com/alsaiduq-lab/nvim-dotfiles.git "${nvim}"
xdg.configFile."nvim" = let echo "Neovim config at ${nvim} was installed"
nvimConfigPath = "${config.home.homeDirectory}/.config/nvim"; else
# nvimDotfiles = builtins.fetchGit { if ${gitDir} -C "${nvim}" pull --ff-only origin master \
# url = "https://github.com/alsaiduq-lab/nvim-dotfiles.git"; | grep -q 'Already up to date.'; then
# ref = "master"; echo "Neovim config at ${nvim} is unchanged"
# rev = "71155b4a4b63d9974f1bc3b66303d6f7e5e06871"; else
# }; echo "Neovim config at ${nvim} was updated"
in { fi
source = pkgs.emptyDirectory; fi
recursive = true;
enable = !builtins.pathExists nvimConfigPath;
onChange = ''
echo "Neovim config at ${nvimConfigPath} was ${
if builtins.pathExists nvimConfigPath
then "skipped (already exists)"
else "installed"
}"
''; '';
};
} }