This flake provides a Nix package for Ratty, a GPU-rendered terminal emulator with inline 3D graphics.
x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwin
# Run directly
nix run github:orhun/ratty
# Install to profile
nix profile install github:orhun/ratty{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
ratty.url = "github:orhun/ratty";
};
outputs = { nixpkgs, ratty, ... }: {
# Use in your configuration
};
}Add ratty to your system packages with optional declarative configuration:
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
ratty.url = "github:orhun/ratty";
};
outputs = { nixpkgs, ratty, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
ratty.nixosModules.default
./configuration.nix
];
};
};
}# configuration.nix
{
programs.ratty = {
enable = true;
settings = {
window = {
opacity = 0.9;
width = 1200;
height = 800;
};
shell = {
program = "zsh";
};
font = {
family = "JetBrains Mono";
size = 14;
};
};
};
}This will:
- Install the Ratty package
- Write configuration to
/etc/ratty/ratty.toml(only whensettingsis non-empty) - Wrap the binary to use
--config-file /etc/ratty/ratty.toml(only whensettingsis non-empty)
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:
{
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.
For user-level configuration without root:
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
ratty.url = "github:orhun/ratty";
};
outputs = { nixpkgs, home-manager, ratty, ... }: {
homeConfigurations.myuser = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
ratty.homeManagerModules.default
./home.nix
];
};
};
}# home.nix
{
programs.ratty = {
enable = true;
settings = {
window = {
opacity = 0.85;
};
shell = {
program = "fish";
};
theme = {
foreground = "#c0caf5";
background = "#1a1b26";
};
};
};
}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 whensettingsis non-empty) - Set
WGPU_BACKENDandWGPU_ADAPTER_NAMEin the user session when GPU options are configured - Ratty discovers this path automatically
Same options as NixOS, but applied via home.sessionVariables instead of a
binary wrapper:
{
programs.ratty = {
enable = true;
gpuBackend = "vulkan";
gpuAdapter = "RTX 3060";
};
}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.<system>.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 |
flake.nix — Orchestration, modules, devShell
nix/default.nix — Standalone package (upstreamable to nixpkgs)
The package definition in nix/default.nix is designed to be upstreamed to nixpkgs as pkgs/by-name/ra/ratty/package.nix. It takes only standard nixpkgs arguments — no flake-specific constructs.
# Enter dev shell
nix develop
# Build package
nix build
# Run checks (build + tests)
nix flake check- DarthPJB darthpjb@gmail.com