about summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-12-25 20:20:52 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-01-24 22:13:36 +0200
commitfd60260a770739eb206f6f063cc30bf4beb21b88 (patch)
treeb3705c1fdc7658f385ba5fb7710d066f00f0b67c /pkgs/top-level
parent5ad696b06763b7c5c6e1aa7ed848a50bff78c8d5 (diff)
downloadnixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar.gz
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar.bz2
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar.lz
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar.xz
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.tar.zst
nixlib-fd60260a770739eb206f6f063cc30bf4beb21b88.zip
platforms.nix: selectPlatformBySystem: Convert to "switch-case"
Looks generally nicer and used recently in nixpkgs in e.g.
3e197f7d8 ("top-level: Normalize stdenv booting")
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/platforms.nix16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix
index 671aaea4491a..e6c55241b354 100644
--- a/pkgs/top-level/platforms.nix
+++ b/pkgs/top-level/platforms.nix
@@ -443,12 +443,12 @@ rec {
     };
   };
 
-  selectPlatformBySystem = system:
-    if system == "armv6l-linux" then raspberrypi
-    else if system == "armv7l-linux" then armv7l-hf-multiplatform
-    else if system == "armv5tel-linux" then sheevaplug
-    else if system == "mips64el-linux" then fuloong2f_n32
-    else if system == "x86_64-linux" then pc64
-    else if system == "i686-linux" then pc32
-    else pcBase;
+  selectPlatformBySystem = system: {
+      "i686-linux" = pc32;
+      "x86_64-linux" = pc64;
+      "armv5tel-linux" = sheevaplug;
+      "armv6l-linux" = raspberrypi;
+      "armv7l-linux" = armv7l-hf-multiplatform;
+      "mips64el-linux" = fuloong2f_n32;
+    }.${system} or pcBase;
 }