You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite requiring flake-compat as a dependency for both stable & flake users, flakes are still required to run the build.
$ nix-buildunpacking 'https://github.com/NixOS/flake-compat/archive/5edf11c44bc78a0d334f6334cdaf7d60d732daab.tar.gz' into the Git cache...error: … in the left operand of the update (//) operator at $XDG_PROJECTS_DIR/nixfmt/default.nix:9:1: 8| in 9| result.packages.nixfmt // result | ^ 10| … while evaluating the attribute 'packages.nixfmt' at $XDG_PROJECTS_DIR/nixfmt/main.nix:152:5: 151| packages = { 152| nixfmt = build; | ^ 153| nixfmt-static = buildStatic; (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it
Ok, so you're just running nix-build at the root of the nixfmt repo? Sorry, I wasn't sure if you were pulling in indirectly through some other project.
Note: nix-build --arg nixpkgs "" works… maybe it should be the default nixpkgs ? for default.nix?
I'd like to understand how to reproduce the issue before discussing fixes.
$ nix-build --option experimental-features fetch-treeerror: … in the left operand of the update (//) operator at /home/matt/code/nixfmt/default.nix:9:1: 8| in 9| result.packages.nixfmt // result | ^ 10| … while evaluating the attribute 'packages.nixfmt' at /home/matt/code/nixfmt/main.nix:152:5: 151| packages = { 152| nixfmt = build; | ^ 153| nixfmt-static = buildStatic; (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it
It looks like you're running into an upstream bug with builtins.fetchTree: NixOS/nix#5541
If you don't want to enable flakes, you'll need to disable fetch-tree until that issue is resolved.
Activity
jfly commentedon Jul 11, 2026
@toastal, I cannot reproduce this (running on 7cad866):
Can you provide more instructions to repro?
toastal commentedon Jul 11, 2026
Like a system config? Not much to say other than
jfly commentedon Jul 11, 2026
I was thinking more like: what's the
default.nixfile you're running in the OP?toastal commentedon Jul 11, 2026
toastal commentedon Jul 11, 2026
Note:
nix-build --arg nixpkgs "<nixpkgs>"works… maybe it should be the defaultnixpkgs ? <nixpkgs>fordefault.nix?jfly commentedon Jul 11, 2026
Ok, so you're just running
nix-buildat the root of the nixfmt repo? Sorry, I wasn't sure if you were pulling in indirectly through some other project.I'd like to understand how to reproduce the issue before discussing fixes.
MattSturgeon commentedon Jul 11, 2026
I can't reproduce with:
from the root directory of the latest
master.MattSturgeon commentedon Jul 11, 2026
But I can with:
It looks like you're running into an upstream bug with
builtins.fetchTree: NixOS/nix#5541If you don't want to enable
flakes, you'll need to disablefetch-treeuntil that issue is resolved.