query
On this page

select

lib.systems.platforms.select

Docs pulled from | This Revision | 11 minutes ago


Nixpkgs manual

included in the platform in order to further elaborate it.

Noogle detected

Implementation

The following is the current implementation of this function.

select =
    platform:
    # x86
    if platform.isx86 then
      pc

    # ARM
    else if platform.isAarch32 then
      let
        version = platform.parsed.cpu.version or null;
      in
      if version == null then
        pc
      else if lib.versionOlder version "6" then
        sheevaplug
      else if lib.versionOlder version "7" then
        raspberrypi
      else
        armv7l-hf-multiplatform

    else if platform.isAarch64 then
      if platform.isDarwin then apple-m1 else aarch64-multiplatform

    else if platform.isLoongArch64 then
      loongarch64-multiplatform

    else if platform.isRiscV then
      riscv-multiplatform

    else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then
      (import ./examples.nix { inherit lib; }).mipsel-linux-gnu

    else if platform.isPower64 then
      if platform.isLittleEndian then powernv else ppc64

    else if platform.isSh4 then
      {
        linux-kernel = {
          target = "vmlinux";
          # SH arch doesn't have a 'make install' target.
          installTarget = "vmlinux";
        };
      }

    else
      { };