mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
doc: Improve code listings
By adding prompts and removing unnecessary indentation.
This commit is contained in:
parent
47297487c5
commit
e1af37634b
13 changed files with 173 additions and 161 deletions
|
@ -132,11 +132,11 @@ buildImage {
|
|||
<para>
|
||||
By default <function>buildImage</function> will use a static date of one second past the UNIX Epoch. This allows <function>buildImage</function> to produce binary reproducible images. When listing images with <command>docker images</command>, the newly created images will be listed like this:
|
||||
</para>
|
||||
<screen><![CDATA[
|
||||
$ docker images
|
||||
<screen>
|
||||
<prompt>$ </prompt>docker images
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
hello latest 08c791c7846e 48 years ago 25.2MB
|
||||
]]></screen>
|
||||
</screen>
|
||||
<para>
|
||||
You can break binary reproducibility but have a sorted, meaningful <literal>CREATED</literal> column by setting <literal>created</literal> to <literal>now</literal>.
|
||||
</para>
|
||||
|
@ -152,11 +152,11 @@ pkgs.dockerTools.buildImage {
|
|||
]]></programlisting>
|
||||
<para>
|
||||
and now the Docker CLI will display a reasonable date and sort the images as expected:
|
||||
<screen><![CDATA[
|
||||
$ docker images
|
||||
<screen>
|
||||
<prompt>$ </prompt>docker images
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
hello latest de2bf4786de6 About a minute ago 25.2MB
|
||||
]]></screen>
|
||||
</screen>
|
||||
however, the produced images will not be binary reproducible.
|
||||
</para>
|
||||
</example>
|
||||
|
|
|
@ -38,8 +38,7 @@ buildContainer {
|
|||
|
||||
readonly = false; <co xml:id='ex-ociTools-buildContainer-3' />
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<calloutlist>
|
||||
<callout arearefs='ex-ociTools-buildContainer-1'>
|
||||
<para>
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
</para>
|
||||
<para>
|
||||
In order to set this up, you first have to <link xlink:href="https://its.uiowa.edu/support/article/102186">download the <literal>.cr</literal> file from the Netscaler Gateway</link>. After that you can configure the <command>selfservice</command> like this:
|
||||
<screen>
|
||||
<prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr
|
||||
<prompt>$ </prompt>selfservice
|
||||
</screen>
|
||||
<screen>
|
||||
<prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr
|
||||
<prompt>$ </prompt>selfservice
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -18,10 +18,13 @@
|
|||
includes all available plugins. To make use of this functionality, use an
|
||||
overlay or directly install an expression that overrides its configuration,
|
||||
such as
|
||||
<programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
|
||||
<programlisting>
|
||||
rxvt-unicode.override {
|
||||
configure = { availablePlugins, ... }: {
|
||||
plugins = with availablePlugins; [ perls resize-font vtwheel ];
|
||||
}
|
||||
}</programlisting>
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
If the <literal>configure</literal> function returns an attrset without the
|
||||
<literal>plugins</literal> attribute, <literal>availablePlugins</literal>
|
||||
will be used automatically.
|
||||
|
@ -30,18 +33,22 @@
|
|||
<para>
|
||||
In order to add plugins but also keep all default plugins installed, it is
|
||||
possible to use the following method:
|
||||
<programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
|
||||
plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ];
|
||||
};
|
||||
}</programlisting>
|
||||
<programlisting>
|
||||
rxvt-unicode.override {
|
||||
configure = { availablePlugins, ... }: {
|
||||
plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ];
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To get a list of all the plugins available, open the Nix REPL and run
|
||||
<programlisting>$ nix repl
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix repl
|
||||
:l <nixpkgs>
|
||||
map (p: p.name) pkgs.rxvt-unicode.plugins
|
||||
</programlisting>
|
||||
</screen>
|
||||
Alternatively, if your shell is bash or zsh and have completion enabled,
|
||||
simply type <literal>nixpkgs.rxvt-unicode.plugins.<tab></literal>.
|
||||
</para>
|
||||
|
@ -53,18 +60,24 @@ map (p: p.name) pkgs.rxvt-unicode.plugins
|
|||
<literal>extraDeps</literal> can be used, for example, to provide
|
||||
<literal>xsel</literal> (a clipboard manager) to the clipboard plugin,
|
||||
without installing it globally:
|
||||
<programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
|
||||
pluginsDeps = [ xsel ];
|
||||
}
|
||||
}</programlisting>
|
||||
<programlisting>
|
||||
rxvt-unicode.override {
|
||||
configure = { availablePlugins, ... }: {
|
||||
pluginsDeps = [ xsel ];
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<literal>perlDeps</literal> is a handy way to provide Perl packages to
|
||||
your custom plugins (in <literal>$HOME/.urxvt/ext</literal>). For example,
|
||||
if you need <literal>AnyEvent</literal> you can do:
|
||||
<programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
|
||||
perlDeps = with perlPackages; [ AnyEvent ];
|
||||
}
|
||||
}</programlisting>
|
||||
<programlisting>
|
||||
rxvt-unicode.override {
|
||||
configure = { availablePlugins, ... }: {
|
||||
perlDeps = with perlPackages; [ AnyEvent ];
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
@ -90,7 +103,8 @@ map (p: p.name) pkgs.rxvt-unicode.plugins
|
|||
<para>
|
||||
If the plugin is itself a perl package that needs to be imported from
|
||||
other plugins or scripts, add the following passthrough:
|
||||
<programlisting>passthru.perlPackages = [ "self" ];
|
||||
<programlisting>
|
||||
passthru.perlPackages = [ "self" ];
|
||||
</programlisting>
|
||||
This will make the urxvt wrapper pick up the dependency and set up the perl
|
||||
path accordingly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue