3 Urxvt, also known as rxvt-unicode, is a highly customizable terminal emulator.
5 ## Configuring urxvt {#sec-urxvt-conf}
7 In `nixpkgs`, urxvt is provided by the package `rxvt-unicode`. It can be configured to include your choice of plugins, reducing its closure size from the default configuration which includes all available plugins. To make use of this functionality, use an overlay or directly install an expression that overrides its configuration, such as:
10 rxvt-unicode.override {
11 configure = { availablePlugins, ... }: {
12 plugins = with availablePlugins; [ perls resize-font vtwheel ];
17 If the `configure` function returns an attrset without the `plugins` attribute, `availablePlugins` will be used automatically.
19 In order to add plugins but also keep all default plugins installed, it is possible to use the following method:
22 rxvt-unicode.override {
23 configure = { availablePlugins, ... }: {
24 plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ];
29 To get a list of all the plugins available, open the Nix REPL and run
34 map (p: p.name) pkgs.rxvt-unicode.plugins
37 Alternatively, if your shell is bash or zsh and have completion enabled, type `nixpkgs.rxvt-unicode.plugins.<tab>`.
39 In addition to `plugins` the options `extraDeps` and `perlDeps` can be used to install extra packages. `extraDeps` can be used, for example, to provide `xsel` (a clipboard manager) to the clipboard plugin, without installing it globally:
42 rxvt-unicode.override {
43 configure = { availablePlugins, ... }: {
44 pluginsDeps = [ xsel ];
49 `perlDeps` is a handy way to provide Perl packages to your custom plugins (in `$HOME/.urxvt/ext`). For example, if you need `AnyEvent` you can do:
52 rxvt-unicode.override {
53 configure = { availablePlugins, ... }: {
54 perlDeps = with perlPackages; [ AnyEvent ];
59 ## Packaging urxvt plugins {#sec-urxvt-pkg}
61 Urxvt plugins resides in `pkgs/applications/misc/rxvt-unicode-plugins`. To add a new plugin, create an expression in a subdirectory and add the package to the set in `pkgs/applications/misc/rxvt-unicode-plugins/default.nix`.
63 A plugin can be any kind of derivation, the only requirement is that it should always install perl scripts in `$out/lib/urxvt/perl`. Look for existing plugins for examples.
65 If the plugin is itself a Perl package that needs to be imported from other plugins or scripts, add the following passthrough:
69 passthru.perlPackages = [ "self" ];
73 This will make the urxvt wrapper pick up the dependency and set up the Perl path accordingly.