20 , withX11 ? !stdenv.isDarwin
27 , withWayland ? !stdenv.isDarwin
31 rlinkLibs = if stdenv.isDarwin then [
33 darwin.apple_sdk_11_0.frameworks.AppKit
35 (lib.getLib gcc-unwrapped)
40 ] ++ lib.optionals withX11 [
46 ] ++ lib.optionals withWayland [
50 rustPlatform.buildRustPackage rec {
54 src = fetchFromGitHub {
58 hash = "sha256-q3Wq7jIYE4g1uPAlpzNWvwUvMy9eN6NQNmPNC4cFmYg=";
61 cargoHash = "sha256-SP85se+H4jL/cXyvfbFS2lxpNSjuptAIPs3/htcrMcw=";
65 ] ++ lib.optionals stdenv.isLinux [
71 runtimeDependencies = rlinkLibs;
73 buildInputs = rlinkLibs;
75 outputs = [ "out" "terminfo" ];
77 buildNoDefaultFeatures = true;
79 ++ lib.optional withX11 "x11"
80 ++ lib.optional withWayland "wayland";
83 # Fail to run in sandbox environment.
84 "--skip=screen::context::test"
88 install -D -m 644 misc/rio.desktop -t $out/share/applications
89 install -D -m 644 misc/logo.svg \
90 $out/share/icons/hicolor/scalable/apps/rio.svg
92 install -dm 755 "$terminfo/share/terminfo/r/"
93 tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo
94 mkdir -p $out/nix-support
95 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
96 '' + lib.optionalString stdenv.isDarwin ''
97 mkdir $out/Applications/
98 mv misc/osx/Rio.app/ $out/Applications/
99 mkdir $out/Applications/Rio.app/Contents/MacOS/
100 ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/
104 updateScript = nix-update-script {
105 extraArgs = [ "--version-regex" "v([0-9.]+)" ];
108 tests.test = nixosTests.terminal-emulators.rio;
112 description = "A hardware-accelerated GPU terminal emulator powered by WebGPU";
113 homepage = "https://raphamorim.io/rio";
114 license = lib.licenses.mit;
115 maintainers = with lib.maintainers; [ otavio oluceps ];
116 platforms = lib.platforms.unix;
117 changelog = "https://github.com/raphamorim/rio/blob/v${version}/CHANGELOG.md";