Closed qcu266 closed 1 year ago
If they do not, please include your .chezmoiexternal
configuration and the output of chezmoi doctor
as well as any other information you discover while looking over those.
@halostatue Thank you very much for the assistance you provided,I found a solution in #3065 。
However, I also encountered some confusing aspects. I'm not sure if it's a bug or intentionally designed this way.
The following configuration should work:
# with chezmoi add exact dir: `dot_config/exact_nvim/exact_lua/exact_custom`
[".config/nvim"]
type = "archive"
url = "https://github.com/NvChad/NvChad/archive/refs/heads/v2.0.tar.gz"
exact = true
stripComponents = 1
refreshPeriod = "168h"
However, the configuration below will result in the same “inconsistent state” error:
# with chezmoi add exact dir: `dot_config/exact_nvim/exact_lua/exact_custom`
[".config/nvim"]
type = "git-repo"
url = "https://github.com/NvChad/NvChad"
exact = true
stripComponents = 1
clone.args = ["--branch", "v2.0", "--depth", "1"]
pull.args = ["--ff-only"]
refreshPeriod = "168h"
I’m glad you found at least a partial solution here, but as I am not using externals in this way, I am the wrong person to answer those questions. Hopefully someone else will be able to chime in on this.
tl;dr if you want to add your own files to an external directory, use type = "archive"
.
However, I also encountered some confusing aspects. I'm not sure if it's a bug or intentionally designed this way.
I agree that this is confusing. There are good design reasons behind the decision. What's happening is:
When the external type = "archive"
, then chezmoi downloads the archive and gets a full, precise view of the state of every file. This means that chezmoi can merge this state with its own state (e.g. the extra dot_config/nvim/lua/custom
file) and get a consistent view of what you want in your home directory.
When the external type = "git-repo"
, then chezmoi delegates management of that directory to git. git is a large, complex application with many subtleties, and chezmoi cannot hope to follow git's behavior exactly. So, chezmoi does not attempt to merge its state, which is why you get the "inconsistent state" error.
So, your use of type = "archive"
is the right approach here.
What exactly are you trying to do?
I used neovim nvchad, however nvchad custom config script should in subdir
lua/custom
.so, I want to use
.chezmoiexternal.toml
to manager nvchad offical repo code , and to usedot_config/nvim/lua/custom
to manager myself config.However, I got
inconsistent state
error:How to configure this scenario?
What have you tried so far?
Describe what you have tried so far.
Where else have you checked for solutions?