Skip to content

Commit c9cfb24

Browse files
committed
build(nix): intro combine-profiles
This commit introduces a (regrettably opaque) helper function for composing build environments from an arbitrary combination of profiles. Signed-off-by: Daniel Noland <[email protected]>
1 parent e1f4f76 commit c9cfb24

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

profiles.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ let
5151
secure.NIX_CXXFLAGS_COMPILE = secure.NIX_CFLAGS_COMPILE;
5252
# handing the CFLAGS back to clang/lld is basically required for -fsanitize
5353
secure.NIX_CFLAGS_LINK = secure.NIX_CFLAGS_COMPILE;
54+
combine-profiles =
55+
features:
56+
builtins.foldl' (
57+
acc: elem: builtins.mapAttrs (var: val: (acc.${var} or [ ]) ++ val) elem
58+
) { } features;
5459
in
5560
{
5661

0 commit comments

Comments
 (0)