updated flake to be better lol
This commit is contained in:
37
flake.nix
37
flake.nix
@@ -40,19 +40,45 @@
|
||||
luarocks
|
||||
];
|
||||
|
||||
nvim-wrapped = pkgs.symlinkJoin {
|
||||
name = "nvim-with-lsp";
|
||||
nvimRemoteConfig = pkgs.runCommand "nvim-remote-config" { } ''
|
||||
mkdir -p $out/nvim-remote
|
||||
cp ${./init.lua} $out/nvim-remote/init.lua
|
||||
cp -r ${./lua} $out/nvim-remote/lua
|
||||
'';
|
||||
|
||||
mkWrappedNvim =
|
||||
{
|
||||
name,
|
||||
extraWrapArgs ? "",
|
||||
}:
|
||||
pkgs.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [ pkgs.neovim ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
meta.mainProgram = "nvim";
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/nvim \
|
||||
--prefix PATH : ${pkgs.lib.makeBinPath pkgList} \
|
||||
--set TREE_SITTER_LIB_PATH "${pkgs.tree-sitter}/lib"
|
||||
--set TREE_SITTER_LIB_PATH "${pkgs.tree-sitter}/lib" \
|
||||
${extraWrapArgs}
|
||||
'';
|
||||
};
|
||||
|
||||
nvim-wrapped = mkWrappedNvim { name = "nvim"; };
|
||||
|
||||
nvim-remote = mkWrappedNvim {
|
||||
name = "nvim-remote";
|
||||
extraWrapArgs = ''
|
||||
--set NVIM_APPNAME "nvim-remote" \
|
||||
--set XDG_CONFIG_HOME "${nvimRemoteConfig}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.${system}.default = nvim-wrapped;
|
||||
packages.${system} = {
|
||||
default = nvim-wrapped;
|
||||
remote = nvim-remote;
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
|
||||
@@ -62,8 +88,7 @@
|
||||
|
||||
shellHook = ''
|
||||
export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib"
|
||||
echo "Neovim LSP environment loaded"
|
||||
export DEVSHELL_NAME=" flake/#89dceb"
|
||||
export DEVSHELL_NAME=" flake/#89dceb| neovim/green"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user