diff options
author | Jacek Galowicz <jacek@galowicz.de> | 2021-01-28 23:03:02 +0100 |
---|---|---|
committer | Jacek Galowicz <jacek@galowicz.de> | 2021-01-28 23:49:05 +0100 |
commit | 001ba3934e329a457d26c4f45e666b2091c7dd80 (patch) | |
tree | 910af38979f5395d8d0039c2f2209da6e7941efc | |
parent | 123045a57056b997165be4963cbf62120a967fec (diff) |
Use lib.cartesianProducOfSets where lib.crossLists was used
-rw-r--r-- | nixos/modules/services/x11/display-managers/default.nix | 6 | ||||
-rw-r--r-- | nixos/tests/predictable-interface-names.nix | 8 | ||||
-rw-r--r-- | pkgs/os-specific/solo5/default.nix | 9 |
3 files changed, 14 insertions, 9 deletions
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 6945a241f92fc..9fdbe753dad50 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -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 diff --git a/nixos/tests/predictable-interface-names.nix b/nixos/tests/predictable-interface-names.nix index bab091d57acf1..c0b472638a14d 100644 --- a/nixos/tests/predictable-interface-names.nix +++ b/nixos/tests/predictable-interface-names.nix @@ -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) diff --git a/pkgs/os-specific/solo5/default.nix b/pkgs/os-specific/solo5/default.nix index 2dbeca98051d9..19d1aa3b5ebe1 100644 --- a/pkgs/os-specific/solo5/default.nix +++ b/pkgs/os-specific/solo5/default.nix @@ -50,10 +50,11 @@ in stdenv.mkDerivation { homepage = "https://github.com/solo5/solo5"; license = licenses.isc; maintainers = [ maintainers.ehmry ]; - platforms = lib.crossLists (arch: os: "${arch}-${os}") [ - [ "aarch64" "x86_64" ] - [ "freebsd" "genode" "linux" "openbsd" ] - ]; + platforms = builtins.map ({arch, os}: "${arch}-${os}") + (cartesianProductOfSets { + arch = [ "aarch64" "x86_64" ]; + os = [ "freebsd" "genode" "linux" "openbsd" ]; + }); }; } |