jdx/mise · error
encrypted dotfile requires an external source, not inline…
Error message
encrypted dotfile {target} requires an external source, not inline content or edits What it means
Encryption applies to files loaded from an external `source`. If a dotfile entry sets `encrypt = true` but also provides inline `content`, or block/line/template edits (`block`, `line`, `template` keys), there is no single external file body to encrypt, so `validate_incoming_files` rejects the combination.
Solutions
- Move the content into a real file and set `source` instead of inline `content`, keeping `encrypt = true`
- Remove `encrypt = true` if inline content or edits are the actual intent
- Apply edits to the sourced file before encryption rather than declaring them on the encrypted entry
Example fix
// before
"~/.netrc" = { encrypt = true, content = "machine x login y" }
// after
"~/.netrc" = { source = "dotfiles/netrc", encrypt = true } Defensive patterns
Strategy: validation
Validate before calling
const INLINE_KEYS = ['content','block','line','template'];
function encryptionConflict(entry) {
return entry?.encrypt === true && INLINE_KEYS.some(k => k in entry);
} Type guard
const isExternalEncrypted = (e: any) => e?.encrypt === true && typeof e?.source === 'string' && e.content === undefined;
Prevention
- Use `encrypt` only with a `source` pointing at a real file
- Keep inline `content` and edit directives unencrypted
When it happens
Trigger: An entry like `"~/.x" = { encrypt = true, content = "..." }` or `encrypt = true` together with `block`/`line`/`template` edit directives.
Common situations: Users wanting to encrypt managed line edits or templated files; combining an encryption flag copied from one example with an inline-content example.
Related errors
- an implied source entry key must be relative
- an implied source entry key must not be empty
- an implied source entry key must not contain '..'
- conflicting dotfile declarations for
- destination variants require an explicit source unless the…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/9af9cdf192a81362.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/files.rs:647
pub(crate) fn validate_incoming_files(config_files: &ConfigMap) -> Result<()> {
for (path, config) in config_files {
let Some(dotfiles) = config.dotfiles_config() else {
continue;
};
for (target, value) in dotfiles.0 {
if value.as_table().is_some_and(|t| {
t.contains_key("encrypt")
&& t.get("encrypt").and_then(toml::Value::as_bool).is_none()
}) {
bail!("dotfile {target}: encrypt must be a boolean");
}
if value.as_table().is_some_and(|t| {
t.get("encrypt").and_then(toml::Value::as_bool) == Some(true)
&& ["content", "block", "line", "template"]
.iter()
.any(|key| t.contains_key(*key))
}) {
bail!(
"encrypted dotfile {target} requires an external source, not inline content or edits"
);
}
let Some(entry) = file_entry_from_toml(&target, value.clone()) else {
// Managed line/block edits are handled by the edit engine,
// not by this whole-file declaration parser.
if value.as_table().is_some_and(|table| {
["block", "line", "template", "comment", "position"]
.iter()
.any(|key| table.contains_key(*key))
}) {
continue;
}
bail!("invalid dotfile declaration {target} in {}", path.display());
};
if let Some(table) = value.as_table() {
for key in table.keys() {
if !matches!(View on GitHub (pinned to 533346cc37)