programs/bash: install nix-bash-completions if completion is enabled

Changed files
+10
nixos
doc
manual
release-notes
modules
programs
bash
+7
nixos/doc/manual/release-notes/rl-1803.xml
···
and <literal>stopJob</literal> provide an optional <literal>$user</literal> argument for that purpose.
</para>
</listitem>
</itemizedlist>
</section>
···
and <literal>stopJob</literal> provide an optional <literal>$user</literal> argument for that purpose.
</para>
</listitem>
+
<listitem>
+
<para>
+
Enabling bash completion on NixOS, <literal>programs.bash.enableCompletion</literal>, will now also enable
+
completion for the Nix command line tools by installing the
+
<link xlink:href="https://github.com/hedning/nix-bash-completions">nix-bash-completions</link> package.
+
</para>
+
</listitem>
</itemizedlist>
</section>
+3
nixos/modules/programs/bash/bash.nix
···
"/share/bash-completion"
];
environment.shells =
[ "/run/current-system/sw/bin/bash"
"/var/run/current-system/sw/bin/bash"
···
"/share/bash-completion"
];
+
environment.systemPackages = optional cfg.enableCompletion
+
pkgs.nix-bash-completions;
+
environment.shells =
[ "/run/current-system/sw/bin/bash"
"/var/run/current-system/sw/bin/bash"