Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

programs.w3m.enable

Whether to enable the w3m terminal web browser.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.w3m.package

The w3m package to use.

Type: null or package

Default:

pkgs.w3m

Declared by:

programs.w3m.bindings

Keybindings for w3m.

See https://git.sr.ht/~rkta/w3m/tree/master/item/doc/README.keymap for documentation.

Type: attribute set of string

Default:

{ }

Example:

{
  "\";\"" = "MARK_WORD";
  C-a = "LINE_BEGIN";
  DEL = "CLOSE_TAB";
  M-C-j = "SAVE_LINK";
  M-TAB = "PREV_LINK";
  O = "COMMAND \"SET_OPTION dictprompt='GOTO: '; SET_OPTION dictcommand=file:/cgi-bin/opener.cgi ; DICT_WORD\"";
  SPC = "NEXT_PAGE";
  UP = "MOVE_UP";
  "\\\"" = "REG_MARK";
  "\\^" = "LINE_BEGIN";
  gg = "BEGIN";
}

Declared by:

programs.w3m.bookmarks.marks

Bookmark file for w3m.

Type: attribute set of list of (submodule)

Default:

{ }

Example:

{
  archlinux = [
    {
      name = "aur";
      url = "https://aur.archlinux.org/";
    }
    {
      name = "archwiki";
      url = "https://wiki.archlinux.org/title/Main_page";
    }
  ];
  nix = [
    {
      name = "nixos manual";
      url = "https://nixos.org/manual/nixos/stable/";
    }
    {
      name = "home-manager manual";
      url = "https://nix-community.github.io/home-manager/";
    }
  ];
}

Declared by:

programs.w3m.bookmarks.marks.<name>.*.name

Display name of bookmark.

Type: string

Declared by:

programs.w3m.bookmarks.marks.<name>.*.url

Destination address of bookmark.

Type: string

Declared by:

programs.w3m.bookmarks.title

Title of the bookmarks page.

Type: string

Default:

"Bookmarks"

Declared by:

programs.w3m.cgiBin

Scripts located in w3m’s cgi-bin directory. For security reasons, w3m can only read scripts from here and ${pkgs.w3m}/libexec/w3m/cgi-bin/ (referenceable as $LIB in w3m). The cgi-bin scripts can be written in any language and have access to the query provided to them through the QUERY_STRING environment variable. A cgi-bin script can send commands back to w3m via stdout with the form “W3m-control: <command>”.

See https://git.sr.ht/~rkta/w3m/tree/master/item/doc/MANUAL.html for more information.

As of w3m v0.5.5, the option cgi_bin isn’t defined by default. If you want to use any cgi-bin scripts in w3m then set programs.w3m.settings.cgi_bin.

Type: attribute set of (submodule)

Default:

{ }

Example:

{
  "search.cgi" = {
    text = ''
      #!/usr/bin/env sh
      
      PREFIX=$(echo "$QUERY_STRING" | cut -d ':' -f1)
      INPUT=$(echo "$QUERY_STRING" | cut -d ':' -f2-)
      
      case $PREFIX in
        aw) echo "W3m-control: GOTO https://wiki.archlinux.org/index.php?search=$INPUT";;
        ddg) echo "W3m-control: GOTO https://lite.duckduckgo.com/lite/?q=$INPUT";;
      esac
      
      echo "W3m-control: DELETE_PREVBUF"
    '';
  };
}

Declared by:

programs.w3m.cgiBin.<name>.source

Path to script file.

Type: null or absolute path

Default:

null

Declared by:

programs.w3m.cgiBin.<name>.text

Inline content of script file.

Type: null or strings concatenated with “\n”

Default:

null

Declared by:

programs.w3m.extraPackages

Extra packages available to w3m.

Type: list of package

Default:

[ ]

Example:

[ pkgs.rdrview pkgs.libsixel ]

Declared by:

programs.w3m.finalPackage

Final W3m package that respects homePage, xdg.enable, and w3mImg2Sixel.

Type: package (read only)

Declared by:

programs.w3m.homePage

Page w3m opens to if a url isn’t provided.

Type: string

Default:

"https://duckduckgo.com"

Example:

"\${config.xdg.configHome}/w3m/bookmark.html"

Declared by:

programs.w3m.settings

Settings for w3m typically set on the OPTIONS page. The best way to configure them is setting them in w3m then nixifying the w3m config file located at either ~/.w3m/config or ~/$XDG_CONFIG_HOME/w3m/config.

Type: attribute set of (string or signed integer)

Default:

{ }

Example:

{
  cgi_bin = "\${config.xdg.configHome}/w3m/cgi-bin";
  extbrowser = "firefox";
  siteconf_file = "\${config.xdg.configHome}/w3m/siteconf";
  tabstop = 4;
  urimethodmap = "\${config.xdg.configHome}/w3m/urimethodmap";
}

Declared by:

programs.w3m.siteconf

Settings for w3m’s siteconf. It allows you to match on a url pattern and do various things like url substitutions, site-specific user agent settings, specifying charset, and a few others.

See https://git.sr.ht/~rkta/w3m/tree/master/item/doc/README.siteconf for documentation and examples.

As of w3m v0.5.5, siteconf doesn’t respect the W3M_DIR environment variable, so unless programs.w3m.settings.siteconf_file is set, siteconf will always be at ~/.w3m/siteconf.

Type: list of (submodule)

Default:

[ ]

Example:

[
  {
    preferences = [
      "substitute_url \"https://lite.duckduckgo.com\""
    ];
    url = "m!^https://duckduckgo.com/!i";
  }
  {
    preferences = [
      "url_charset utf-8"
      "substitute_url \"https://eo.wikipedia.org\""
    ];
    url = "m!^https://wikipedia.org/! exact";
  }
]

Declared by:

programs.w3m.siteconf.*.preferences

The preferences that w3m can apply to the matched url. Options are: substitute_url "<destination-url>", url_charset <charset>, no_referer_from on|off, no_referer_to on|off, user_agent "string".

Type: list of string

Default:

[ ]

Declared by:

programs.w3m.siteconf.*.url

The url that the preferences should apply to. Can be of the form <url>, m!<regex>!, m@<regex>@, or /<regex>/ with optional trailing “i” for case insensitive and “exact” for exact matches.

Type: string

Declared by:

programs.w3m.urimethodmap

Settings for w3m’s urimethodmap. It allows you to define custom uri schemes and map them to scripts. Scripts must be in the directory defined in programs.w3m.settings.cgi_bin.

As of w3m v0.5.5, urimethodmap doesn’t respect the W3M_DIR environment variable, so unless programs.w3m.settings.urimethodmap is set, urimethodmap will always be at ~/.w3m/urimethodmap.

Type: attribute set of string

Default:

{ }

Example:

{
  ddg = "file:/cgi-bin/search.cgi?%s";
  help = "file:/$LIB/w3mhelp.cgi?%s";
}

Declared by:

programs.w3m.w3mImg2Sixel

The executable and arguments that w3m should execute when using libsixel as the image backend.

Type: null or string

Default:

"img2sixel"

Example:

"img2sixel -d atkinson"

Declared by: