glistix/nix/system

Types

Represents a possible system (architecture and OS) where Nix is being used. Includes most common options, with an additional escape hatch.

pub type System {
  X8664Linux
  X8664Darwin
  Aarch64Linux
  Aarch64Darwin
  I686Linux
  Other(String)
}

Constructors

  • X8664Linux
  • X8664Darwin
  • Aarch64Linux
  • Aarch64Darwin
  • I686Linux
  • Other(String)

Functions

pub fn from_string(string: String) -> System

Parses a System from a string.

Examples

from_string("x86_64-linux")
// -> X8664Linux
from_string("aarch64-darwin")
// -> Aarch64Darwin
from_string("riscv-unknown")
// -> Other("riscv-unknown")
pub fn to_string(system: System) -> String

Converts a System to its string representation.

Examples

to_string(X8664Linux)
// -> "x86_64-linux"
to_string(Aarch64Darwin)
// -> "aarch64-darwin"
to_string(Other("riscv-unknown"))
// -> "riscv-unknown"
Search Document