platforms.nix: selectPlatformBySystem: Convert to "switch-case"
Looks generally nicer and used recently in nixpkgs in e.g. 3e197f7d8 ("top-level: Normalize stdenv booting")
This commit is contained in:
parent
5ad696b067
commit
fd60260a77
@ -443,12 +443,12 @@ rec {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
selectPlatformBySystem = system:
|
selectPlatformBySystem = system: {
|
||||||
if system == "armv6l-linux" then raspberrypi
|
"i686-linux" = pc32;
|
||||||
else if system == "armv7l-linux" then armv7l-hf-multiplatform
|
"x86_64-linux" = pc64;
|
||||||
else if system == "armv5tel-linux" then sheevaplug
|
"armv5tel-linux" = sheevaplug;
|
||||||
else if system == "mips64el-linux" then fuloong2f_n32
|
"armv6l-linux" = raspberrypi;
|
||||||
else if system == "x86_64-linux" then pc64
|
"armv7l-linux" = armv7l-hf-multiplatform;
|
||||||
else if system == "i686-linux" then pc32
|
"mips64el-linux" = fuloong2f_n32;
|
||||||
else pcBase;
|
}.${system} or pcBase;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user