chore: add native deduplication to flake checks
Currently, if I deploy multiple nodes from a single repo (i.e. deploy --targets .#a .#b) it should run nix flake check . for each node/ path for the node. Thus, it should be run two times, my attempt is to deduplicate by the path such as it will only get run once regardless of the amount of nodes deployed from that repo.
That is my understanding of the issue described in #318.
Have I missed something?
Hey what exactly do you mean by evaluating? Evaluating the configuration of the particular host, i.e. the system config or doing the nix flake check?
I'm getting multiple evaluations of the same flake (. in this case):
$ deploy --targets .#aux .#backup .#mail .#mon .#web
đ âšī¸ [deploy] [INFO] Running checks for flake in .
warning: unknown flake output 'deploy'
warning: The check omitted these incompatible systems: aarch64-darwin, aarch64-linux, x86_64-darwin
Use '--all-systems' to check all.
đ âšī¸ [deploy] [INFO] Evaluating flake in .
đ âšī¸ [deploy] [INFO] Evaluating flake in .
đ âšī¸ [deploy] [INFO] Evaluating flake in .
đ âšī¸ [deploy] [INFO] Evaluating flake in .
đ âšī¸ [deploy] [INFO] Evaluating flake in .
...
I'm referring to the multiple evaluations that should also be able to be de-duplicated, since one evaluation per flake should result in all nodes.
That is a misconception on your part. For each node/ profile the nixosConfiguration (via. outputs.nixosConfiguration.config.system.build.toplevel`) is evaluated in that step. As deploy-rs does not know anything about this configuration it cannot assume that the configuration is the same across the nodes/ profiles. In essence, it could be evaluated in a singe step (for all requested host) instead of for each once, but that complicates the design of the program, the speed-up is not huge and is therefore not used.