numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
269 stars 83 forks source link

`error: attribute 'busybox' missing` when using latest nixpkgs #55

Closed srid closed 1 year ago

srid commented 1 year ago

Describe the bug

treefmt-nix doesn't evaluate correctly when using the latest nixpkgs flake. Expect:

       error: attribute 'busybox' missing

       at /nix/store/w92n9zhbizs1l3vy1x9aj2j9wc6xscld-source/pkgs/stdenv/linux/bootstrap-tools/default.nix:6:13:

            5|
            6|   builder = bootstrapFiles.busybox;
             |             ^
            7|

To Reproduce

Steps to reproduce the behavior:

  1. The first commit in this PR: https://github.com/srid/haskell-template/pull/96

Expected behavior

Build shouldn't break.

System information

Please see the PR. Error appears on both Github Linux builder and my M1 macOS machine.

Additional context

Trigger seems to be this commit: https://github.com/numtide/treefmt-nix/commit/f6fb7a360544ee36fb5271bd0a2f773811dc29fa

When I use its parent commit, the error goes away. Thus my workaround is to set flakeFormatter = false;.

zimbatm commented 1 year ago

I'm pretty sure that this is an issue with nixpkgs. We use nixpkgs with no overrides or anything fancy.

srid commented 1 year ago

Yea, I saw it happen in other contexts too. 🤷🏿