mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-17 04:02:24 +00:00
statusline and exlcude lazylock
This commit is contained in:
parent
905375ff1a
commit
3836361bfe
4 changed files with 27 additions and 4 deletions
|
|
@ -48,6 +48,7 @@ for _, plugin in ipairs(disabled_plugins) do
|
||||||
end
|
end
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||||
|
local lazylock = vim.fn.stdpath('state') .. '/lazy-lock.json'
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
if not vim.uv.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
'git',
|
'git',
|
||||||
|
|
@ -63,4 +64,5 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
require('lazy').setup('plugins', {
|
require('lazy').setup('plugins', {
|
||||||
defaults = { lazy = false },
|
defaults = { lazy = false },
|
||||||
change_detection = { enabled = false },
|
change_detection = { enabled = false },
|
||||||
|
lockfile = lazylock,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,9 @@ return {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "FugitiveHead", "diff" },
|
lualine_b = { "FugitiveHead", "diff" },
|
||||||
lualine_c = { { "filename", path = 0 } },
|
lualine_c = { { "filename", path = 0 } },
|
||||||
lualine_x = { "diagnostics" },
|
lualine_x = {},
|
||||||
lualine_y = { "filetype" },
|
lualine_y = {},
|
||||||
lualine_z = { theme_status, "progress" },
|
lualine_z = { "progress" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,12 @@
|
||||||
}: let
|
}: let
|
||||||
nvimConfig = lib.cleanSourceWith {
|
nvimConfig = lib.cleanSourceWith {
|
||||||
src = ../config/nvim;
|
src = ../config/nvim;
|
||||||
filter = path: type: builtins.baseNameOf path != ".git";
|
filter = path: type:
|
||||||
|
builtins.baseNameOf path != ".git"
|
||||||
|
&& builtins.baseNameOf path != "lazy-lock.json";
|
||||||
};
|
};
|
||||||
|
lazyLockSeed = ../config/nvim/lazy-lock.json;
|
||||||
|
lazyLockPath = "${config.xdg.stateHome}/nvim/lazy-lock.json";
|
||||||
python = pkgs.writeShellScriptBin "python" ''
|
python = pkgs.writeShellScriptBin "python" ''
|
||||||
exec ${pkgs.python3}/bin/python3 "$@"
|
exec ${pkgs.python3}/bin/python3 "$@"
|
||||||
'';
|
'';
|
||||||
|
|
@ -52,4 +56,15 @@ in {
|
||||||
source = nvimConfig;
|
source = nvimConfig;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.activation.seedNvimLazyLock = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
state_dir="${config.xdg.stateHome}/nvim"
|
||||||
|
lockfile="${lazyLockPath}"
|
||||||
|
|
||||||
|
if [ ! -e "$lockfile" ]; then
|
||||||
|
mkdir -p "$state_dir"
|
||||||
|
cp ${lazyLockSeed} "$lockfile"
|
||||||
|
chmod u+w "$lockfile"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -250,6 +250,12 @@
|
||||||
|
|
||||||
if command -v wt >/dev/null 2>&1; then
|
if command -v wt >/dev/null 2>&1; then
|
||||||
eval "$(command wt config shell init zsh)"
|
eval "$(command wt config shell init zsh)"
|
||||||
|
|
||||||
|
# `wt` changes directories by sourcing directives into the current shell,
|
||||||
|
# so wrappers around it must stay shell functions instead of scripts.
|
||||||
|
wtc() {
|
||||||
|
wt switch --create --base @ "$@"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue