Flake integration in README.md fails with error: attribute 'config' missing
#273
Labels
bug
Something isn't working
error: attribute 'config' missing
#273
Describe the bug
When I copy over the example Flake configuration from README.md and attempt to run either
nix fmt
ornix flake check
, I get an error. Specifically, runningnix fmt
produceswhile running
nix flake check
producesTo Reproduce
Steps to reproduce the behavior:
cd
into itgit init
flake.nix
andtreefmt.nix
from the Flakes readme sectiongit add -A
nix fmt
ornix flake check
Expected behavior
Running
nix fmt
should not fail. The example configuration enables theterraform
formatter but an empty repository contains no Terraform files, so this should be a no-op.Likewise, running
nix flake check
should not fail but be a no-op in the example empty repository.System information
Running MacOS Sonoma 14.7.1, my Nix version is 2.24.10.
Additional context
I tracked the error to
eachDefaultSystem
being called in this section offlake.nix
:When I write my
flake.nix
like this instead, everything is working fine:However, I'm not sure if this is how the configuration should be written, so I wanted to discuss this first before opening a PR.
The text was updated successfully, but these errors were encountered: