jdx/mise · error

unsupported Nix profile manifest version

Error message

unsupported Nix profile manifest version {}; expected version 3 (Nix 2.24 or newer)

What it means

mise reads the Nix profile manifest (`nix profile list --json`) to determine which packages are installed, and only understands manifest version 3 (or the named-entries JSON shape produced by Nix 2.24+). If the JSON parses but its `version` field is not 3 — typically an older Nix — the parse aborts so mise never misreads an old-format manifest.

Solutions

  1. Upgrade Nix to 2.24 or newer (`nix upgrade-nix` or your package manager).
  2. Recreate the profile with the modern Nix so the manifest is rewritten in the current format.
  3. On CI, bump the Nix install action/version to >= 2.24.
  4. If you just upgraded Nix, ensure `nix profile list --profile <path>` reports `"version": 3` before running mise.

Example fix

// before (old Nix manifest)
{"version":2,"elements":[...]}

// after upgrading Nix >= 2.24
{"version":3,"elements":{"0":{...}}}
Defensive patterns

Strategy: validation

Validate before calling

const manifest = JSON.parse(raw);
if (manifest.version !== 3) {
  throw new Error(`Nix profile manifest v${manifest.version} unsupported; need Nix >= 2.24`);
}

Type guard

const isV3 = (m: {version: number}) => m.version === 3;

Try / catch

match Profile::parse(&json) {
    Err(e) if e.to_string().contains("manifest version") => reinstall_with_modern_nix(),
    Err(e) => return Err(e),
    Ok(p) => use(p),
}

Prevention

When it happens

Trigger: `Profile::parse` succeeds deserializing the manifest JSON, but `profile.version` is e.g. 2 or 4 because the system Nix is older/newer than expected while the file shape coincidentally parses.

Common situations: Distributions shipping Nix older than 2.24; stale profiles created by an old Nix that persist after upgrading; CI images pinned to an old Nix version.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/77b7d1d8fe062246. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/nix.rs:107

}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct Element {
    active: bool,
    original_url: Option<String>,
    attr_path: Option<String>,
    outputs: Option<Value>,
    store_paths: Vec<String>,
}

impl Profile {
    fn parse(json: &str) -> Result<Self> {
        let profile: Self = serde_json::from_str(json).wrap_err(
            "Nix bootstrap requires profile JSON with named entries (Nix 2.24 or newer); upgrade Nix and use a modern `nix profile` profile",
        )?;
        if profile.version != 3 {
            bail!(
                "unsupported Nix profile manifest version {}; expected version 3 (Nix 2.24 or newer)",
                profile.version
            );
        }
        Ok(profile)
    }
}

#[derive(Deserialize)]
struct ParsedReferences {
    system: String,
    refs: Vec<Value>,
}

#[derive(Clone)]
struct MatchedEntry {
    name: String,
    paths: Vec<String>,

View on GitHub (pinned to 533346cc37)