0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

Use lib.cartesianProducOfSets where lib.crossLists was used

This commit is contained in:
Jacek Galowicz 2021-01-28 23:03:02 +01:00
parent 123045a570
commit 001ba3934e
3 changed files with 14 additions and 9 deletions

View file

@ -444,8 +444,8 @@ in
in
# We will generate every possible pair of WM and DM.
concatLists (
crossLists
(dm: wm: let
builtins.map
({dm, wm}: let
sessionName = "${dm.name}${optionalString (wm.name != "none") ("+" + wm.name)}";
script = xsession dm wm;
desktopNames = if dm ? desktopNames
@ -472,7 +472,7 @@ in
providedSessions = [ sessionName ];
})
)
[dms wms]
(cartesianProductOfSets { dm = dms; wm = wms; })
);
# Make xsessions and wayland sessions available in XDG_DATA_DIRS

View file

@ -5,7 +5,11 @@
let
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: {
testCombinations = pkgs.lib.cartesianProductOfSets {
predictable = [true false];
withNetworkd = [true false];
};
in pkgs.lib.listToAttrs (builtins.map ({ predictable, withNetworkd }: {
name = pkgs.lib.optionalString (!predictable) "un" + "predictable"
+ pkgs.lib.optionalString withNetworkd "Networkd";
value = makeTest {
@ -30,4 +34,4 @@ in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: {
machine.${if predictable then "fail" else "succeed"}("ip link show eth0")
'';
};
}) [[true false] [true false]])
}) testCombinations)