Nix

Nix Code Screenshot Generator

Turn Nix snippets into images worth sharing, without leaving your Mac.

Nix expressions are shared as images more often than most, because the audience is usually being talked through an unfamiliar syntax.

Codeshot detects Nix from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    nodejs_20
    swift
  ];

  shellHook = ''
    echo "codeshot dev shell"
  '';
}
GitHub · dark
{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    nodejs_20
    swift
  ];

  shellHook = ''
    echo "codeshot dev shell"
  '';
}
Solarized · dark
{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    nodejs_20
    swift
  ];

  shellHook = ''
    echo "codeshot dev shell"
  '';
}
Tokyo Night · dark

Choosing a theme for Nix

Nix nests deeply and the closing braces matter. Leave enough vertical room that the expression closes inside the frame.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for Nix, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS