20 , withX11 ? !stdenv.isDarwin
27 , withWayland ? !stdenv.isDarwin
31 rlinkLibs = if stdenv.isDarwin then [
33 darwin.apple_sdk_11_0.frameworks.AppKit
34 darwin.apple_sdk_11_0.frameworks.AVFoundation
35 darwin.apple_sdk_11_0.frameworks.Vision
37 (lib.getLib gcc-unwrapped)
42 ] ++ lib.optionals withX11 [
48 ] ++ lib.optionals withWayland [
52 rustPlatform.buildRustPackage rec {
56 src = fetchFromGitHub {
60 hash = "sha256-rY5nuZcMbK9PYxfGYdVheOOVIC4I/11EOWpNmG6gH9A=";
63 cargoHash = "sha256-tHcUMxe9HwTzm2oDwaTyuh+UZUwW64xPX/cftxqZoz8=";
67 ] ++ lib.optionals stdenv.isLinux [
73 runtimeDependencies = rlinkLibs;
75 buildInputs = rlinkLibs;
77 outputs = [ "out" "terminfo" ];
79 buildNoDefaultFeatures = true;
81 ++ lib.optional withX11 "x11"
82 ++ lib.optional withWayland "wayland";
85 # Fail to run in sandbox environment.
86 "--skip=screen::context::test"
90 install -D -m 644 misc/rio.desktop -t $out/share/applications
91 install -D -m 644 misc/logo.svg \
92 $out/share/icons/hicolor/scalable/apps/rio.svg
94 install -dm 755 "$terminfo/share/terminfo/r/"
95 tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo
96 mkdir -p $out/nix-support
97 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
98 '' + lib.optionalString stdenv.isDarwin ''
99 mkdir $out/Applications/
100 mv misc/osx/Rio.app/ $out/Applications/
101 mkdir $out/Applications/Rio.app/Contents/MacOS/
102 ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/
106 updateScript = nix-update-script {
107 extraArgs = [ "--version-regex" "v([0-9.]+)" ];
110 tests.test = nixosTests.terminal-emulators.rio;
114 description = "A hardware-accelerated GPU terminal emulator powered by WebGPU";
115 homepage = "https://raphamorim.io/rio";
116 license = lib.licenses.mit;
117 maintainers = with lib.maintainers; [ tornax otavio oluceps ];
118 platforms = lib.platforms.unix;
119 changelog = "https://github.com/raphamorim/rio/blob/v${version}/CHANGELOG.md";