mass replace "flip map -> forEach"

See `forEach`-introduction commit.
```
rg 'flip map ' --files-with-matches | xargs sed -i 's/flip map /forEach /g'
```

danbst 0f8596ab 91bb646e

Changed files
+28 -28
nixos
doc
manual
lib
maintainers
modules
services
monitoring
networking
x11
system
boot
loader
grub
tasks
tests
pkgs
applications
networking
irc
weechat
remote
citrix-receiver
citrix-workspace
tools
inputmethods
ibus-engines
ibus-typing-booster
+1 -1
nixos/doc/manual/default.nix
···
+ "</listitem>";
in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>";
-
optionsListDesc = lib.flip map optionsListVisible (opt: opt // {
+
optionsListDesc = lib.forEach optionsListVisible (opt: opt // {
# Clean up declaration sites to not refer to the NixOS source tree.
declarations = map stripAnyPrefixes opt.declarations;
}
+3 -3
nixos/lib/build-vms.nix
···
machinesNumbered = zipLists machines (range 1 254);
-
nodes_ = flip map machinesNumbered (m: nameValuePair m.fst
+
nodes_ = forEach machinesNumbered (m: nameValuePair m.fst
[ ( { config, nodes, ... }:
let
interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255);
-
interfaces = flip map interfacesNumbered ({ fst, snd }:
+
interfaces = forEach interfacesNumbered ({ fst, snd }:
nameValuePair "eth${toString snd}" { ipv4.addresses =
[ { address = "192.168.${toString fst}.${toString m.snd}";
prefixLength = 24;
···
"${config.networking.hostName}\n"));
virtualisation.qemu.options =
-
flip map interfacesNumbered
+
forEach interfacesNumbered
({ fst, snd }: qemuNICFlags snd fst m.snd);
};
}
+1 -1
nixos/maintainers/option-usages.nix
···
# builtins multiply by 4 the memory usage and the time used to compute
# each options.
tryCollectOptions = moduleResult:
-
flip map (excludeOptions (collect isOption moduleResult)) (opt:
+
forEach (excludeOptions (collect isOption moduleResult)) (opt:
{ name = showOption opt.loc; } // builtins.tryEval (strict opt.value));
in
keepNames (
+1 -1
nixos/modules/rename.nix
···
# KSM
(mkRenamedOptionModule [ "hardware" "enableKSM" ] [ "hardware" "ksm" "enable" ])
-
] ++ (flip map [ "blackboxExporter" "collectdExporter" "fritzboxExporter"
+
] ++ (forEach [ "blackboxExporter" "collectdExporter" "fritzboxExporter"
"jsonExporter" "minioExporter" "nginxExporter" "nodeExporter"
"snmpExporter" "unifiExporter" "varnishExporter" ]
(opt: mkRemovedOptionModule [ "services" "prometheus" "${opt}" ] ''
+1 -1
nixos/modules/services/monitoring/ups.nix
···
''
maxstartdelay = ${toString cfg.maxStartDelay}
-
${flip concatStringsSep (flip map (attrValues cfg.ups) (ups: ups.summary)) "
+
${flip concatStringsSep (forEach (attrValues cfg.ups) (ups: ups.summary)) "
"}
'';
+1 -1
nixos/modules/services/networking/consul.nix
···
++ cfg.extraConfigFiles;
devices = attrValues (filterAttrs (_: i: i != null) cfg.interface);
-
systemdDevices = flip map devices
+
systemdDevices = forEach devices
(i: "sys-subsystem-net-devices-${utils.escapeSystemdPath i}.device");
in
{
+1 -1
nixos/modules/services/networking/hylafax/systemd.nix
···
inherit (lib) concatStringsSep optionalString;
cfg = config.services.hylafax;
-
mapModems = lib.flip map (lib.attrValues cfg.modems);
+
mapModems = lib.forEach (lib.attrValues cfg.modems);
mkConfigFile = name: conf:
# creates hylafax config file,
+1 -1
nixos/modules/services/networking/ssh/sshd.nix
···
assertions = [{ assertion = if cfg.forwardX11 then cfgc.setXAuthLocation else true;
message = "cannot enable X11 forwarding without setting xauth location";}]
-
++ flip map cfg.listenAddresses ({ addr, ... }: {
+
++ forEach cfg.listenAddresses ({ addr, ... }: {
assertion = addr != null;
message = "addr must be specified in each listenAddresses entry";
});
+1 -1
nixos/modules/services/x11/xautolock.nix
···
assertion = cfg.killer != null -> cfg.killtime >= 10;
message = "killtime has to be at least 10 minutes according to `man xautolock`";
}
-
] ++ (lib.flip map [ "locker" "notifier" "nowlocker" "killer" ]
+
] ++ (lib.forEach [ "locker" "notifier" "nowlocker" "killer" ]
(option:
{
assertion = cfg."${option}" != null -> builtins.substring 0 1 cfg."${option}" == "/";
+1 -1
nixos/modules/services/x11/xserver.nix
···
in imap1 mkHead cfg.xrandrHeads;
xrandrDeviceSection = let
-
monitors = flip map xrandrHeads (h: ''
+
monitors = forEach xrandrHeads (h: ''
Option "monitor-${h.config.output}" "${h.name}"
'');
# First option is indented through the space in the config but any
+1 -1
nixos/modules/system/boot/loader/grub/grub.nix
···
assertion = if args.efiSysMountPoint == null then true else hasPrefix "/" args.efiSysMountPoint;
message = "EFI paths must be absolute, not ${args.efiSysMountPoint}";
}
-
] ++ flip map args.devices (device: {
+
] ++ forEach args.devices (device: {
assertion = device == "nodev" || hasPrefix "/" device;
message = "GRUB devices must be absolute paths, not ${device} in ${args.path}";
}));
+4 -4
nixos/modules/tasks/network-interfaces-systemd.nix
···
enable = true;
networks."99-main" = genericNetwork mkDefault;
}
-
(mkMerge (flip map interfaces (i: {
+
(mkMerge (forEach interfaces (i: {
netdevs = mkIf i.virtual ({
"40-${i.name}" = {
netdevConfig = {
···
name = mkDefault i.name;
DHCP = mkForce (dhcpStr
(if i.useDHCP != null then i.useDHCP else cfg.useDHCP && interfaceIps i == [ ]));
-
address = flip map (interfaceIps i)
+
address = forEach (interfaceIps i)
(ip: "${ip.address}/${toString ip.prefixLength}");
networkConfig.IPv6PrivacyExtensions = "kernel";
} ];
···
Kind = "bridge";
};
};
-
networks = listToAttrs (flip map bridge.interfaces (bi:
+
networks = listToAttrs (forEach bridge.interfaces (bi:
nameValuePair "40-${bi}" (mkMerge [ (genericNetwork (mkOverride 999)) {
DHCP = mkOverride 0 (dhcpStr false);
networkConfig.Bridge = name;
···
};
-
networks = listToAttrs (flip map bond.interfaces (bi:
+
networks = listToAttrs (forEach bond.interfaces (bi:
nameValuePair "40-${bi}" (mkMerge [ (genericNetwork (mkOverride 999)) {
DHCP = mkOverride 0 (dhcpStr false);
networkConfig.Bond = name;
+6 -6
nixos/modules/tasks/network-interfaces.nix
···
warnings = concatMap (i: i.warnings) interfaces;
assertions =
-
(flip map interfaces (i: {
+
(forEach interfaces (i: {
# With the linux kernel, interface name length is limited by IFNAMSIZ
# to 16 bytes, including the trailing null byte.
# See include/linux/if.h in the kernel sources
···
message = ''
The name of networking.interfaces."${i.name}" is too long, it needs to be less than 16 characters.
'';
-
})) ++ (flip map slaveIfs (i: {
+
})) ++ (forEach slaveIfs (i: {
assertion = i.ipv4.addresses == [ ] && i.ipv6.addresses == [ ];
message = ''
The networking.interfaces."${i.name}" must not have any defined ips when it is a slave.
'';
-
})) ++ (flip map interfaces (i: {
+
})) ++ (forEach interfaces (i: {
assertion = i.preferTempAddress -> cfg.enableIPv6;
message = ''
Temporary addresses are only needed when IPv6 is enabled.
···
"net.ipv6.conf.default.disable_ipv6" = mkDefault (!cfg.enableIPv6);
"net.ipv6.conf.all.forwarding" = mkDefault (any (i: i.proxyARP) interfaces);
} // listToAttrs (flip concatMap (filter (i: i.proxyARP) interfaces)
-
(i: flip map [ "4" "6" ] (v: nameValuePair "net.ipv${v}.conf.${i.name}.proxy_arp" true)))
-
// listToAttrs (flip map (filter (i: i.preferTempAddress) interfaces)
+
(i: forEach [ "4" "6" ] (v: nameValuePair "net.ipv${v}.conf.${i.name}.proxy_arp" true)))
+
// listToAttrs (forEach (filter (i: i.preferTempAddress) interfaces)
(i: nameValuePair "net.ipv6.conf.${i.name}.use_tempaddr" 2));
# Capabilities won't work unless we have at-least a 4.3 Linux
···
${cfg.localCommands}
'';
};
-
} // (listToAttrs (flip map interfaces (i:
+
} // (listToAttrs (forEach interfaces (i:
let
deviceDependency = if (config.boot.isContainer || i.name == "lo")
then []
+1 -1
nixos/tests/networking.nix
···
useNetworkd = networkd;
firewall.checkReversePath = true;
firewall.allowedUDPPorts = [ 547 ];
-
interfaces = mkOverride 0 (listToAttrs (flip map vlanIfs (n:
+
interfaces = mkOverride 0 (listToAttrs (forEach vlanIfs (n:
nameValuePair "eth${toString n}" {
ipv4.addresses = [ { address = "192.168.${toString n}.1"; prefixLength = 24; } ];
ipv6.addresses = [ { address = "fd00:1234:5678:${toString n}::1"; prefixLength = 64; } ];
+1 -1
pkgs/applications/networking/irc/weechat/wrapper.nix
···
init = let
init = builtins.replaceStrings [ "\n" ] [ ";" ] (config.init or "");
-
mkScript = drv: lib.flip map drv.scripts (script: "/script load ${drv}/share/${script}");
+
mkScript = drv: lib.forEach drv.scripts (script: "/script load ${drv}/share/${script}");
scripts = builtins.concatStringsSep ";" (lib.foldl (scripts: drv: scripts ++ mkScript drv)
[ ] (config.scripts or []));
+1 -1
pkgs/applications/networking/remote/citrix-receiver/default.nix
···
versions = [ "13.8.0" "13.9.0" "13.9.1" ];
in
lib.listToAttrs
-
(lib.flip map versions
+
(lib.forEach versions
(v: lib.nameValuePair v (throw "Unsupported citrix_receiver version: ${v}")));
in
deprecatedVersions // supportedVersions;
+1 -1
pkgs/applications/networking/remote/citrix-workspace/default.nix
···
versions = [ ];
in
lib.listToAttrs
-
(lib.flip map versions
+
(lib.forEach versions
(v: lib.nameValuePair v (throw "Unsupported citrix_workspace version: ${v}")));
in
deprecatedVersions // supportedVersions;
+1 -1
pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix
···
let
-
hunspellDirs = with lib; makeSearchPath ":" (flatten (flip map langs (lang: [
+
hunspellDirs = with lib; makeSearchPath ":" (flatten (forEach langs (lang: [
"${hunspellDicts.${lang}}/share/hunspell"
"${hunspellDicts.${lang}}/share/myspell"
"${hunspellDicts.${lang}}/share/myspell/dicts"