summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2020-10-22 13:41:28 +0200
committerRobert Hensing <robert@roberthensing.nl>2020-10-22 13:46:47 +0200
commit4d4682c2b6b1697236662495166b457abfb523cf (patch)
treef6d43ab7279fdf288eef0c5d2fdd60479466464e /lib/options.nix
parent002750572a39758aabf552e90b4d0ce65092ba58 (diff)
downloadnixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar.gz
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar.bz2
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar.lz
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar.xz
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.tar.zst
nixpkgs-4d4682c2b6b1697236662495166b457abfb523cf.zip
lib/options.nix: Use head instead of elemAt _ 0
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 5b7482c8093..9e0ea010bda 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -110,7 +110,7 @@ rec {
     # Return early if we only have one element
     # This also makes it work for functions, because the foldl' below would try
     # to compare the first element with itself, which is false for functions
-    else if length defs == 1 then (elemAt defs 0).value
+    else if length defs == 1 then (head defs).value
     else (foldl' (first: def:
       if def.value != first.value then
         throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"