summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2017-07-04 23:29:23 +0100
committerGitHub <noreply@github.com>2017-07-04 23:29:23 +0100
commit4d545297d85c8f32f7ab496d0759f40d881bd61d (patch)
treec3309bda805bce2028f2fe53b6662bd4a3352936 /nixos/modules/services
parenta0fa61788b930b05afc475b61a9963655e969ef9 (diff)
downloadnixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar.gz
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar.bz2
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar.lz
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar.xz
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.tar.zst
nixlib-4d545297d85c8f32f7ab496d0759f40d881bd61d.zip
lib: introduce imap0, imap1 (#25543)
* lib: introduce imap0, imap1

For historical reasons, imap starts counting at 1 and it's not
consistent with the rest of the lib.

So for now we split imap into imap0 that starts counting at zero and
imap1 that starts counting at 1. And imap is marked as deprecated.

See https://github.com/NixOS/nixpkgs/commit/c71e2d42359f9900ea2c290d141c0d606471da16#commitcomment-21873221

* replace uses of lib.imap

* lib: move imap to deprecated.nix
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/cluster/kubernetes.nix2
-rw-r--r--nixos/modules/services/networking/libreswan.nix2
-rw-r--r--nixos/modules/services/networking/networkmanager.nix2
-rw-r--r--nixos/modules/services/x11/xserver.nix2
4 files changed, 4 insertions, 4 deletions
diff --git a/nixos/modules/services/cluster/kubernetes.nix b/nixos/modules/services/cluster/kubernetes.nix
index 68917af5094c..4c9d9aad0e2d 100644
--- a/nixos/modules/services/cluster/kubernetes.nix
+++ b/nixos/modules/services/cluster/kubernetes.nix
@@ -44,7 +44,7 @@ let
 
   cniConfig = pkgs.buildEnv {
     name = "kubernetes-cni-config";
-    paths = imap (i: entry:
+    paths = imap1 (i: entry:
       pkgs.writeTextDir "${toString (10+i)}-${entry.type}.conf" (builtins.toJSON entry)
     ) cfg.kubelet.cni.config;
   };
diff --git a/nixos/modules/services/networking/libreswan.nix b/nixos/modules/services/networking/libreswan.nix
index c87e738d2a23..e7a6c565f4ff 100644
--- a/nixos/modules/services/networking/libreswan.nix
+++ b/nixos/modules/services/networking/libreswan.nix
@@ -11,7 +11,7 @@ let
 
   trim = chars: str: let
       nonchars = filter (x : !(elem x.value chars))
-                  (imap (i: v: {ind = (sub i 1); value = v;}) (stringToCharacters str));
+                  (imap0 (i: v: {ind = i; value = v;}) (stringToCharacters str));
     in
       if length nonchars == 0 then ""
       else substring (head nonchars).ind (add 1 (sub (last nonchars).ind (head nonchars).ind)) str;
diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index 58c93d8e2ac3..f1b3d298fecb 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -253,7 +253,7 @@ in {
            { source = overrideNameserversScript;
              target = "NetworkManager/dispatcher.d/02overridedns";
            }
-      ++ lib.imap (i: s: {
+      ++ lib.imap1 (i: s: {
         inherit (s) source;
         target = "NetworkManager/dispatcher.d/${dispatcherTypesSubdirMap.${s.type}}03userscript${lib.fixedWidthNumber 4 i}";
       }) cfg.dispatcherScripts;
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index bb9704fc26f0..638509e710be 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -71,7 +71,7 @@ let
       name = "multihead${toString num}";
       inherit config;
     };
-  in imap mkHead cfg.xrandrHeads;
+  in imap1 mkHead cfg.xrandrHeads;
 
   xrandrDeviceSection = let
     monitors = flip map xrandrHeads (h: ''