numtide / flake-utils

Pure Nix flake utility functions [maintainer=@zimbatm]
MIT License
1.14k stars 78 forks source link

Support for nested attributes #91

Closed hamishmack closed 1 year ago

hamishmack commented 1 year ago

We noticed that eachSystem removes things from hydraJobs if you use nested attributes (instead of single flat attribute set). At first we solved this problem by using recursiveUpdate instead of // and this worked and kept the transform to "Hydra's convention" in place (see the first commit in this PR for this change).

We noticed that our eval times when nothing needed building were unusually high (40m). It was not made worse by the fix, but we wondered if the transform itself was the problem. We experimented with removing the special treatment of hydraJobs instead. As well as fixing the nested attribute problem it made evaluation 4x faster (around 10m). It may be a coincidence, but we have 4 supported systems.

See https://github.com/input-output-hk/haskell.nix/pull/1886

zimbatm commented 1 year ago

thanks, I believe this can be merged once the work has been rebased (default.nix has moved to lib.nix)

hamishmack commented 1 year ago

I have rebased the change and squashed it to a single commit.

zimbatm commented 1 year ago

thanks. Sorry to ask this so late, but do you think it's possible to add some tests as well? A single equality asset would already be pretty good.

jbgi commented 1 year ago

@zimbatm, test added in #97

zimbatm commented 1 year ago

thanks, #97 merged