Attempt to fix the mapping of each system

This commit is contained in:
Kaare Hoff Skovgaard 2025-07-05 11:16:36 +02:00
parent 16e2006b09
commit 8a223cffb1
Signed by: khs
GPG key ID: C7D890804F01E9F0

View file

@ -23,7 +23,24 @@
treefmt-nix,
}:
let
forEachSystem = systems: map: nixpkgs.lib.genAttrs systems map;
eachSystemOp =
op: systems: f:
builtins.foldl' (op f) { } systems;
mapEachSystem = eachSystemOp (
f: attrs: system:
let
result = f system;
in
builtins.foldl' (
attrs: key:
attrs
// {
${key} = (attrs.${key} or { }) // {
${system} = result.${key};
};
}
)
);
in
{
lib.mkFlake =
@ -44,9 +61,8 @@
"treeFmtFile"
];
in
(
(snowfall-lib.mkFlake snowfallOptions)
// (forEachSystem systems (
// (mapEachSystem systems (
system:
let
pkgs = import nixpkgs { inherit system; };
@ -64,7 +80,6 @@
] ++ (devShellPackages pkgs);
};
}
))
);
));
};
}