Hey,
how does flake-parts’s withSystem
work?
The docs just say:
Enter the scope of a system. Example:
and give the snippet
{ withSystem, inputs, ... }:
{
# perSystem = { ... }: { config.packages.hello = ...; };
flake.nixosConfigurations.foo = withSystem "x86_64-linux" (ctx@{ config, inputs', pkgs, ... }: {...}
Is it magic or is it some simple attribute set getter exposed in the form of lambda?
I can’t tell form the source code: https://github.com/hercules-ci/flake-parts/blob/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5/modules/withSystem.nix#L8.
Thanks!