From aff276c705436388558e15ffd79146862854c64d Mon Sep 17 00:00:00 2001 From: John Bargman Date: Mon, 22 Jun 2026 15:16:40 +0000 Subject: [PATCH 01/10] feat: add gpuBackend/gpuAdapter module options for wgpu device selection --- flake.nix | 73 +++++++++++++++++++++++++++++++++++++++------------ nix/README.md | 48 +++++++++++++++++++++++++++++---- src/main.rs | 11 ++++++++ 3 files changed, 110 insertions(+), 22 deletions(-) diff --git a/flake.nix b/flake.nix index c65e317..aa83a63 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,30 @@ } ''; }; + + gpuBackend = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "vulkan" "gl" "gles" ]); + default = null; + description = '' + Force the wgpu backend. + Set to null (default) for auto-detection. + Useful when the Vulkan ICD loader selects an incompatible driver + or when running in headless/VNC environments where OpenGL is preferred. + ''; + example = "vulkan"; + }; + + gpuAdapter = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = '' + Substring match to select a specific GPU adapter name. + Set to null (default) to use the system default. + Useful on multi-GPU systems (e.g. integrated + discrete) + or when wgpu picks the wrong adapter. + ''; + example = "RTX 3060"; + }; }; }; in @@ -126,10 +150,14 @@ # window = { opacity = 0.9; }; # shell = { program = "zsh"; }; # }; + # # Optional: force wgpu backend / adapter selection + # gpuBackend = "vulkan"; # "vulkan" | "gl" | "gles" + # gpuAdapter = "RTX 3060"; # substring match # }; # # Config is written to $XDG_CONFIG_HOME/ratty/ratty.toml - # ratty discovers this path automatically. + # GPU env vars are set via home.sessionVariables. + # ratty discovers the config path automatically. homeManagerModules.default = args@{ config, @@ -149,6 +177,10 @@ xdg.configFile."ratty/ratty.toml" = lib.mkIf (cfg.settings != { }) { source = tomlFormat.generate "ratty.toml" cfg.settings; }; + home.sessionVariables = lib.mkMerge [ + (lib.mkIf (cfg.gpuBackend != null) { WGPU_BACKEND = cfg.gpuBackend; }) + (lib.mkIf (cfg.gpuAdapter != null) { WGPU_ADAPTER_NAME = cfg.gpuAdapter; }) + ]; }; }; @@ -161,10 +193,13 @@ # window = { opacity = 0.9; }; # shell = { program = "zsh"; }; # }; + # # Optional: force wgpu backend / adapter selection + # gpuBackend = "vulkan"; # "vulkan" | "gl" | "gles" + # gpuAdapter = "RTX 3060"; # substring match # }; # # Config is written to /etc/ratty/ratty.toml - # Binary is wrapped with --config-file flag to use system config. + # Binary is wrapped with --config-file and GPU env vars when set. nixosModules.default = args@{ config, @@ -181,21 +216,25 @@ inherit (opts) options; config = lib.mkIf cfg.enable { environment.systemPackages = [ - ( - if cfg.settings == { } then - cfg.package - else - pkgs.symlinkJoin { - name = "ratty-system-wrapped"; - paths = [ cfg.package ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - rm -f $out/bin/ratty - makeWrapper ${cfg.package}/bin/ratty $out/bin/ratty \ - --add-flags "--config-file /etc/ratty/ratty.toml" - ''; - } - ) + (let + hasSettings = cfg.settings != { }; + hasGpuOpts = cfg.gpuBackend != null || cfg.gpuAdapter != null; + in + if !(hasSettings || hasGpuOpts) then + cfg.package + else + pkgs.symlinkJoin { + name = "ratty-system-wrapped"; + paths = [ cfg.package ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + rm -f $out/bin/ratty + makeWrapper ${lib.getExe cfg.package} $out/bin/ratty \ + ${lib.optionalString hasSettings "--add-flags \"--config-file /etc/ratty/ratty.toml\""} \ + ${lib.optionalString (cfg.gpuBackend != null) "--set WGPU_BACKEND '${cfg.gpuBackend}'"} \ + ${lib.optionalString (cfg.gpuAdapter != null) "--set WGPU_ADAPTER_NAME '${cfg.gpuAdapter}'"} + ''; + }) ]; environment.etc."ratty/ratty.toml" = lib.mkIf (cfg.settings != { }) { diff --git a/nix/README.md b/nix/README.md index aec8d82..1103425 100644 --- a/nix/README.md +++ b/nix/README.md @@ -89,6 +89,26 @@ This will: - Write configuration to `/etc/ratty/ratty.toml` (only when `settings` is non-empty) - Wrap the binary to use `--config-file /etc/ratty/ratty.toml` (only when `settings` is non-empty) +### GPU Backend Selection + +On systems with multiple GPUs or where the default Vulkan device creation fails +(e.g. NVIDIA 580.x drivers reporting unsupported features), set `gpuBackend` and +`gpuAdapter` to control wgpu device selection: + +```nix +{ + programs.ratty = { + enable = true; + gpuBackend = "vulkan"; # or "gl" / "gles" + gpuAdapter = "RTX 3060"; # substring match against adapter name + }; +} +``` + +When set, the NixOS module wraps the binary with `WGPU_BACKEND` and +`WGPU_ADAPTER_NAME` environment variables. When both `settings` and GPU options +are set, a single wrapper applies all flags. + ## Home Manager Configuration For user-level configuration without root: @@ -139,17 +159,35 @@ This will: - Install the Ratty package to your user profile - Write configuration to `$XDG_CONFIG_HOME/ratty/ratty.toml` (typically `~/.config/ratty/ratty.toml`) (only when `settings` is non-empty) +- Set `WGPU_BACKEND` and `WGPU_ADAPTER_NAME` in the user session when GPU options are configured - Ratty discovers this path automatically +### GPU Backend Selection (Home Manager) + +Same options as NixOS, but applied via `home.sessionVariables` instead of a +binary wrapper: + +```nix +{ + programs.ratty = { + enable = true; + gpuBackend = "vulkan"; + gpuAdapter = "RTX 3060"; + }; +} +``` + ## Module Options Both `nixosModules.default` and `homeManagerModules.default` expose: -| Option | Type | Default | Description | -| ------------------------- | ------- | ------------------------------ | ------------------------------------- | -| `programs.ratty.enable` | bool | `false` | Enable Ratty installation | -| `programs.ratty.package` | package | `self.packages..ratty` | The Ratty package to use | -| `programs.ratty.settings` | attrset | `{}` | Configuration written to `ratty.toml` | +| Option | Type | Default | Description | +| ------------------------- | ------------ | ------------------------------ | -------------------------------------------------- | +| `programs.ratty.enable` | bool | `false` | Enable Ratty installation | +| `programs.ratty.package` | package | `self.packages..ratty` | The Ratty package to use | +| `programs.ratty.settings` | attrset | `{}` | Configuration written to `ratty.toml` | +| `programs.ratty.gpuBackend` | null or enum | `null` | Force wgpu backend: `"vulkan"`, `"gl"`, or `"gles"`. null = auto-detect | +| `programs.ratty.gpuAdapter` | null or str | `null` | Substring match to select a specific GPU adapter (e.g. `"RTX 3060"`). null = auto-detect | ## Package Architecture diff --git a/src/main.rs b/src/main.rs index 82190a2..068e883 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,8 @@ use std::time::Duration; use anyhow::anyhow; use bevy::asset::AssetPlugin; use bevy::prelude::*; +use bevy::render::RenderPlugin; +use bevy::render::settings::{WgpuSettings, WgpuSettingsPriority}; use bevy::window::{PrimaryWindow, WindowCreated, WindowResolution}; use bevy::winit::{UpdateMode, WINIT_WINDOWS, WinitSettings}; use clap::Parser; @@ -82,6 +84,15 @@ fn main() -> anyhow::Result<()> { .set(AssetPlugin { file_path: asset_root.to_string_lossy().into_owned(), ..default() + }) + .set(RenderPlugin { + render_creation: bevy::render::settings::RenderCreation::Automatic( + WgpuSettings { + priority: WgpuSettingsPriority::Compatibility, + ..default() + }, + ), + ..default() }), ) .add_systems(Update, apply_window_icon) From 2953cc092f3c93679b27191988077390c17b5f32 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:07:44 +0000 Subject: [PATCH 02/10] fix(nix): use --set-default for SHELL to respect user's shell --- nix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 2c63e34..3c155cd 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -130,7 +130,7 @@ craneLib.buildPackage (commonArgs // { # Step 2: wrapProgram for env var management wrapProgram $out/bin/ratty \ - --set SHELL '${bash}/bin/bash' \ + --set-default SHELL '${bash}/bin/bash' \ --prefix LD_LIBRARY_PATH : '${runtimeLibraryPath}' \ ${lib.optionalString stdenv.isDarwin '' --prefix DYLD_LIBRARY_PATH : '${runtimeLibraryPath}' \ From af16f471a2adf6fd5a6f5e01dbcef156a5595062 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:09:15 +0000 Subject: [PATCH 03/10] fix(nix): sync version to 0.4.2 --- nix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 3c155cd..886539e 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -58,7 +58,7 @@ let # cache hit rate — dependency hashes don't change when assets/docs change. commonArgs = { pname = "ratty"; - version = "0.4.1"; + version = "0.4.2"; src = craneLib.cleanCargoSource ../.; From 2c153d1c1c5bc7a648a052d66c90f076346fbb33 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:10:21 +0000 Subject: [PATCH 04/10] fix(nix): add metal to gpuBackend enum for Darwin --- flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index aa83a63..c38b239 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,11 @@ }; gpuBackend = lib.mkOption { - type = lib.types.nullOr (lib.types.enum [ "vulkan" "gl" "gles" ]); + type = lib.types.nullOr (lib.types.enum ( + if pkgs.stdenv.isDarwin + then [ "metal" "gl" "gles" ] + else [ "vulkan" "gl" "gles" ] + )); default = null; description = '' Force the wgpu backend. From 60d7cb301042014bb509d3b31bc6f0446b7cbff4 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:11:43 +0000 Subject: [PATCH 05/10] feat(nix): add package null assertions to both modules --- flake.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index c38b239..7d2a6b2 100644 --- a/flake.nix +++ b/flake.nix @@ -177,6 +177,12 @@ { inherit (opts) options; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = cfg.package != null; + message = "programs.ratty.package must not be null when programs.ratty.enable is true"; + } + ]; home.packages = [ cfg.package ]; xdg.configFile."ratty/ratty.toml" = lib.mkIf (cfg.settings != { }) { source = tomlFormat.generate "ratty.toml" cfg.settings; @@ -219,6 +225,12 @@ { inherit (opts) options; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = cfg.package != null; + message = "programs.ratty.package must not be null when programs.ratty.enable is true"; + } + ]; environment.systemPackages = [ (let hasSettings = cfg.settings != { }; From fd685bfa9069b0b09d35cc2fc166fb58574f901c Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:15:17 +0000 Subject: [PATCH 06/10] refactor(nix): replace self capture with pkgs.ratty default + add overlay The package option default now uses pkgs.ratty instead of self.packages, enabling nixpkgs upstreaming. An overlay is provided so consumers can make pkgs.ratty available. --- flake.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 7d2a6b2..ab892f8 100644 --- a/flake.nix +++ b/flake.nix @@ -35,8 +35,8 @@ package = lib.mkOption { type = lib.types.package; - default = self.packages.${pkgs.stdenv.hostPlatform.system}.ratty; - defaultText = lib.literalExpression "self.packages.\${pkgs.stdenv.hostPlatform.system}.ratty"; + default = pkgs.ratty; + defaultText = lib.literalExpression "pkgs.ratty"; description = "The ratty package to install."; }; @@ -134,6 +134,11 @@ formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); + # Overlay — adds pkgs.ratty for use with the NixOS/HM modules. + overlays.default = final: prev: { + ratty = self.packages.${final.stdenv.hostPlatform.system}.ratty; + }; + checks = forEachSystem ( system: let From 540d456d22ac6d636abe711c6050ed3bab4a90e6 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:17:33 +0000 Subject: [PATCH 07/10] feat(nix): add defaultShell option for non-bash users --- flake.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ab892f8..5b4da39 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,16 @@ ''; example = "RTX 3060"; }; + + defaultShell = lib.mkOption { + type = lib.types.nullOr lib.types.package; + default = null; + description = '' + Default shell to use when no -e/--command flag is passed. + Set to null to use the package's built-in default (bash). + ''; + example = lib.literalExpression "pkgs.zsh"; + }; }; }; in @@ -195,6 +205,7 @@ home.sessionVariables = lib.mkMerge [ (lib.mkIf (cfg.gpuBackend != null) { WGPU_BACKEND = cfg.gpuBackend; }) (lib.mkIf (cfg.gpuAdapter != null) { WGPU_ADAPTER_NAME = cfg.gpuAdapter; }) + (lib.mkIf (cfg.defaultShell != null) { SHELL = lib.getExe cfg.defaultShell; }) ]; }; }; @@ -253,7 +264,8 @@ makeWrapper ${lib.getExe cfg.package} $out/bin/ratty \ ${lib.optionalString hasSettings "--add-flags \"--config-file /etc/ratty/ratty.toml\""} \ ${lib.optionalString (cfg.gpuBackend != null) "--set WGPU_BACKEND '${cfg.gpuBackend}'"} \ - ${lib.optionalString (cfg.gpuAdapter != null) "--set WGPU_ADAPTER_NAME '${cfg.gpuAdapter}'"} + ${lib.optionalString (cfg.gpuAdapter != null) "--set WGPU_ADAPTER_NAME '${cfg.gpuAdapter}'"} \ + ${lib.optionalString (cfg.defaultShell != null) "--set-default SHELL '${lib.getExe cfg.defaultShell}'"} ''; }) ]; From bec5e3a2b67a467df0dc5402a82b5ed30709c54c Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 15:19:13 +0000 Subject: [PATCH 08/10] docs(nix): update README with overlay, defaultShell, and Darwin metal backend --- nix/README.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/nix/README.md b/nix/README.md index 1103425..c4e504e 100644 --- a/nix/README.md +++ b/nix/README.md @@ -36,6 +36,27 @@ nix profile install github:orhun/ratty } ``` +### Overlay + +To make `pkgs.ratty` available in your configuration: + +```nix +{ + inputs.ratty.url = "github:orhun/ratty"; + + outputs = { nixpkgs, ratty, ... }: { + nixosConfigurations.myhost = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + { nixpkgs.overlays = [ ratty.overlays.default ]; } + ratty.nixosModules.default + ./configuration.nix + ]; + }; + }; +} +``` + ## NixOS System Configuration Add ratty to your system packages with optional declarative configuration: @@ -181,13 +202,14 @@ binary wrapper: Both `nixosModules.default` and `homeManagerModules.default` expose: -| Option | Type | Default | Description | -| ------------------------- | ------------ | ------------------------------ | -------------------------------------------------- | -| `programs.ratty.enable` | bool | `false` | Enable Ratty installation | -| `programs.ratty.package` | package | `self.packages..ratty` | The Ratty package to use | -| `programs.ratty.settings` | attrset | `{}` | Configuration written to `ratty.toml` | -| `programs.ratty.gpuBackend` | null or enum | `null` | Force wgpu backend: `"vulkan"`, `"gl"`, or `"gles"`. null = auto-detect | -| `programs.ratty.gpuAdapter` | null or str | `null` | Substring match to select a specific GPU adapter (e.g. `"RTX 3060"`). null = auto-detect | +| Option | Type | Default | Description | +| ---------------------------- | ------------- | ------------- | -------------------------------------------------- | +| `programs.ratty.enable` | bool | `false` | Enable Ratty installation | +| `programs.ratty.package` | package | `pkgs.ratty` | The Ratty package to use | +| `programs.ratty.settings` | attrset | `{}` | Configuration written to `ratty.toml` | +| `programs.ratty.gpuBackend` | null or enum | `null` | Force wgpu backend: `"vulkan"` (Linux), `"metal"` (macOS), `"gl"`, or `"gles"`. null = auto-detect | +| `programs.ratty.gpuAdapter` | null or str | `null` | Substring match to select a specific GPU adapter (e.g. `"RTX 3060"`). null = auto-detect | +| `programs.ratty.defaultShell` | null or package | `null` | Default shell for -e fallback. null = package default (bash) | ## Package Architecture From 47c7d3be5f1e07682e18c7cf28853a21dabb2d82 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Tue, 23 Jun 2026 17:26:46 +0000 Subject: [PATCH 09/10] formatting pass --- flake.nix | 71 +++++++++++++++++++------------ nix/default.nix | 109 +++++++++++++++++++++++++----------------------- 2 files changed, 101 insertions(+), 79 deletions(-) diff --git a/flake.nix b/flake.nix index 5b4da39..151a824 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,11 @@ }; outputs = - { self, nixpkgs, crane }: + { + self, + nixpkgs, + crane, + }: let supportedSystems = [ "x86_64-linux" @@ -57,11 +61,22 @@ }; gpuBackend = lib.mkOption { - type = lib.types.nullOr (lib.types.enum ( - if pkgs.stdenv.isDarwin - then [ "metal" "gl" "gles" ] - else [ "vulkan" "gl" "gles" ] - )); + type = lib.types.nullOr ( + lib.types.enum ( + if pkgs.stdenv.isDarwin then + [ + "metal" + "gl" + "gles" + ] + else + [ + "vulkan" + "gl" + "gles" + ] + ) + ); default = null; description = '' Force the wgpu backend. @@ -248,26 +263,30 @@ } ]; environment.systemPackages = [ - (let - hasSettings = cfg.settings != { }; - hasGpuOpts = cfg.gpuBackend != null || cfg.gpuAdapter != null; - in - if !(hasSettings || hasGpuOpts) then - cfg.package - else - pkgs.symlinkJoin { - name = "ratty-system-wrapped"; - paths = [ cfg.package ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - rm -f $out/bin/ratty - makeWrapper ${lib.getExe cfg.package} $out/bin/ratty \ - ${lib.optionalString hasSettings "--add-flags \"--config-file /etc/ratty/ratty.toml\""} \ - ${lib.optionalString (cfg.gpuBackend != null) "--set WGPU_BACKEND '${cfg.gpuBackend}'"} \ - ${lib.optionalString (cfg.gpuAdapter != null) "--set WGPU_ADAPTER_NAME '${cfg.gpuAdapter}'"} \ - ${lib.optionalString (cfg.defaultShell != null) "--set-default SHELL '${lib.getExe cfg.defaultShell}'"} - ''; - }) + ( + let + hasSettings = cfg.settings != { }; + hasGpuOpts = cfg.gpuBackend != null || cfg.gpuAdapter != null; + in + if !(hasSettings || hasGpuOpts) then + cfg.package + else + pkgs.symlinkJoin { + name = "ratty-system-wrapped"; + paths = [ cfg.package ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + rm -f $out/bin/ratty + makeWrapper ${lib.getExe cfg.package} $out/bin/ratty \ + ${lib.optionalString hasSettings "--add-flags \"--config-file /etc/ratty/ratty.toml\""} \ + ${lib.optionalString (cfg.gpuBackend != null) "--set WGPU_BACKEND '${cfg.gpuBackend}'"} \ + ${lib.optionalString (cfg.gpuAdapter != null) "--set WGPU_ADAPTER_NAME '${cfg.gpuAdapter}'"} \ + ${lib.optionalString ( + cfg.defaultShell != null + ) "--set-default SHELL '${lib.getExe cfg.defaultShell}'"} + ''; + } + ) ]; environment.etc."ratty/ratty.toml" = lib.mkIf (cfg.settings != { }) { diff --git a/nix/default.nix b/nix/default.nix index 886539e..1ca8e7d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -95,62 +95,65 @@ let in # Build the full package, reusing cached dependency artifacts. -craneLib.buildPackage (commonArgs // { - inherit cargoArtifacts; +craneLib.buildPackage ( + commonArgs + // { + inherit cargoArtifacts; - # The full source (including assets, config, website) is needed for - # postInstall below. buildDepsOnly already handled the filtered source. - src = ../.; + # The full source (including assets, config, website) is needed for + # postInstall below. buildDepsOnly already handled the filtered source. + src = ../.; - desktopItems = [ - (makeDesktopItem { - name = "ratty"; - desktopName = "Ratty"; - comment = "A GPU-rendered terminal emulator with inline 3D graphics"; - exec = "ratty"; - terminal = false; - categories = [ - "System" - "TerminalEmulator" - "Utility" - ]; - icon = "ratty"; - }) - ]; + desktopItems = [ + (makeDesktopItem { + name = "ratty"; + desktopName = "Ratty"; + comment = "A GPU-rendered terminal emulator with inline 3D graphics"; + exec = "ratty"; + terminal = false; + categories = [ + "System" + "TerminalEmulator" + "Utility" + ]; + icon = "ratty"; + }) + ]; - # Assets are embedded at compile time via rust-embed. - # Copy them to $out/share for reference and custom model discovery fallback. - postInstall = '' - # Step 1: Copy assets - mkdir -p $out/share/ratty - cp -r assets/objects $out/share/ratty/ - install -Dm644 config/ratty.toml $out/share/ratty/ratty.toml - install -Dm644 website/assets/images/ratty-logo.png \ - $out/share/icons/hicolor/512x512/apps/ratty.png + # Assets are embedded at compile time via rust-embed. + # Copy them to $out/share for reference and custom model discovery fallback. + postInstall = '' + # Step 1: Copy assets + mkdir -p $out/share/ratty + cp -r assets/objects $out/share/ratty/ + install -Dm644 config/ratty.toml $out/share/ratty/ratty.toml + install -Dm644 website/assets/images/ratty-logo.png \ + $out/share/icons/hicolor/512x512/apps/ratty.png - # Step 2: wrapProgram for env var management - wrapProgram $out/bin/ratty \ - --set-default SHELL '${bash}/bin/bash' \ - --prefix LD_LIBRARY_PATH : '${runtimeLibraryPath}' \ - ${lib.optionalString stdenv.isDarwin '' - --prefix DYLD_LIBRARY_PATH : '${runtimeLibraryPath}' \ - --prefix DYLD_FALLBACK_LIBRARY_PATH : '${runtimeLibraryPath}' \ - ''} + # Step 2: wrapProgram for env var management + wrapProgram $out/bin/ratty \ + --set-default SHELL '${bash}/bin/bash' \ + --prefix LD_LIBRARY_PATH : '${runtimeLibraryPath}' \ + ${lib.optionalString stdenv.isDarwin '' + --prefix DYLD_LIBRARY_PATH : '${runtimeLibraryPath}' \ + --prefix DYLD_FALLBACK_LIBRARY_PATH : '${runtimeLibraryPath}' \ + ''} - # Step 3: Thin wrapper for conditional -e "$SHELL" injection. - # The --run script is defined as a separate Nix string to avoid - # the nested double-tick problem (Nix does not support nested double-tick strings). - mv $out/bin/ratty $out/bin/.ratty-env-wrapped - makeWrapper $out/bin/.ratty-env-wrapped $out/bin/ratty \ - --run '${runScript}' - ''; + # Step 3: Thin wrapper for conditional -e "$SHELL" injection. + # The --run script is defined as a separate Nix string to avoid + # the nested double-tick problem (Nix does not support nested double-tick strings). + mv $out/bin/ratty $out/bin/.ratty-env-wrapped + makeWrapper $out/bin/.ratty-env-wrapped $out/bin/ratty \ + --run '${runScript}' + ''; - meta = { - description = "GPU-rendered terminal emulator with inline 3D graphics"; - homepage = "https://github.com/orhun/ratty"; - license = lib.licenses.mit; - maintainers = [ "daniejbolt" ]; - mainProgram = "ratty"; - platforms = lib.platforms.unix; - }; -}) + meta = { + description = "GPU-rendered terminal emulator with inline 3D graphics"; + homepage = "https://github.com/orhun/ratty"; + license = lib.licenses.mit; + maintainers = [ "daniejbolt" ]; + mainProgram = "ratty"; + platforms = lib.platforms.unix; + }; + } +) From dc12d5e19052879b6fec73cc3d4e90ca456ce629 Mon Sep 17 00:00:00 2001 From: John Bargman Date: Sun, 19 Jul 2026 15:22:21 +0000 Subject: [PATCH 10/10] update pkgs for latest rust-c --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 832b3fe..ee8027c 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1777954456, - "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", + "lastModified": 1784356753, + "narHash": "sha256-12KrbMiWLcf8m7pCvAtZh1ZrgF85ZXDXvfR/fWTKy84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", + "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a", "type": "github" }, "original": {