remove ~ dir... yes I did accidentally delete my real home directory when I tried this the first time... that was fun
This commit is contained in:
parent
0b833d555c
commit
2acfbc84b4
3 changed files with 25 additions and 36 deletions
|
@ -130,16 +130,16 @@
|
|||
# TODO do I need to set all the XDG_ env vars? - or should I remove this entirely?
|
||||
"--set"
|
||||
"XDG_CONFIG_HOME"
|
||||
"~/.config/nvim_flaked"
|
||||
"/tmp/nvim_flaked/config"
|
||||
"--set"
|
||||
"XDG_DATA_HOME"
|
||||
"~/.local/share/nvim_flaked"
|
||||
"/tmp/nvim_flaked/share"
|
||||
"--set"
|
||||
"XDG_RUNTIME_DIR"
|
||||
"/tmp/nvim.user/nvim_flaked/xxx"
|
||||
"/tmp/nvim_flaked/run"
|
||||
"--set"
|
||||
"XDG_STATE_HOME"
|
||||
"~/.local/state/nvim_flaked"
|
||||
"/tmp/nvim_flaked/state"
|
||||
];
|
||||
})
|
||||
|
||||
|
|
47
init.lua
47
init.lua
|
@ -1,26 +1,14 @@
|
|||
if NVIM_CONFIG_STORE_PATH then
|
||||
-- Function to add subdirectories to package.path
|
||||
local function add_lua_subdirs_to_path(base_dir)
|
||||
local scan_dir
|
||||
scan_dir = function(dir)
|
||||
package.path = package.path .. ";" .. dir .. "?.lua"
|
||||
package.path = package.path .. ";" .. dir .. "?/init.lua"
|
||||
local paths = vim.fn.globpath(dir, '*/', 0, 1)
|
||||
for _, subdir in ipairs(paths) do
|
||||
scan_dir(subdir) -- Recursively add subdirectories
|
||||
end
|
||||
end
|
||||
scan_dir(base_dir)
|
||||
end
|
||||
-- Call the function with the base directory of your Lua modules
|
||||
add_lua_subdirs_to_path(NVIM_CONFIG_STORE_PATH .. "/lua/")
|
||||
-- Add my lua dir to the path. THIS IS NOT RECURSIVE!
|
||||
-- For recursive we can do something like this: https://github.com/RingOfStorms/nvim/blob/0b833d555c69e88b450a10eec4e39a782bad1037/init.lua#L1-L17
|
||||
-- However this pollutes the path, it oculd be limited to just init files but this approach here one level deep is adequate for my own needs
|
||||
package.path = package.path .. ";" .. NVIM_CONFIG_STORE_PATH .. "/lua/?.lua"
|
||||
package.path = package.path .. ";" .. NVIM_CONFIG_STORE_PATH .. "/lua/?/init.lua"
|
||||
end
|
||||
|
||||
require("options")
|
||||
require("keymaps")
|
||||
|
||||
print("NIX FLAKE NVIM: nvim packages " .. vim.inspect(NVIM_PLUGIN_PATHS))
|
||||
|
||||
-- When using nix, it will set lazy via LAZY env variable.
|
||||
local lazypath = vim.env.LAZY or (vim.fn.stdpath("data") .. "/lazy/lazy.nvim")
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
|
@ -44,25 +32,32 @@ end
|
|||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
print("TEST")
|
||||
local asd = require("catppuccin")
|
||||
print("TEST2 " .. vim.inspect(asd))
|
||||
-- local asd = require("plugins")
|
||||
-- print("TEST2 " .. vim.inspect(asd))
|
||||
|
||||
-- Setup lazy
|
||||
function getSpec()
|
||||
if NVIM_CONFIG_STORE_PATH then
|
||||
-- TODO use same strategy as the tools/init.lua to auto import these
|
||||
return { require("plugins.catppuccin") }
|
||||
else
|
||||
-- TODO I want this to work in the nixos version
|
||||
-- but it is not resolving properly to the nix store.
|
||||
-- Will revisit at some point, instead we manually pull them
|
||||
-- in above.
|
||||
return { { import = "plugins" } }
|
||||
end
|
||||
end
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
spec = getSpec(),
|
||||
change_detection = {
|
||||
enabled = false,
|
||||
},
|
||||
defaults = {
|
||||
-- lazy = true
|
||||
},
|
||||
-- install = {
|
||||
-- colorscheme = { "catppuccin" },
|
||||
-- }
|
||||
})
|
||||
|
||||
-- vim.cmd("colorscheme catppuccin")
|
||||
vim.cmd("colorscheme catppuccin")
|
||||
require("tools")
|
||||
require("autocommands")
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
WRN 2024-04-30T01:39:24.865 ?.1519525 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
||||
WRN 2024-04-30T10:45:55.120 ?.1604443 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
||||
WRN 2024-04-30T10:51:56.393 ?.1611908 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
||||
WRN 2024-04-30T10:54:55.143 ?.1619079 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
||||
WRN 2024-04-30T10:55:21.678 ?.1619181 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
||||
WRN 2024-04-30T10:55:38.457 ?.1625034 server_start:164: Failed to start server: no such file or directory: /tmp/nvim.user/nvim_flaked/xxx/
|
Loading…
Add table
Add a link
Reference in a new issue