bash: support bash completion
This commit is contained in:
parent
d9e03b7f8c
commit
f5e9879e74
6 changed files with 60 additions and 1 deletions
23
tests/modules/programs/bash/completion.nix
Normal file
23
tests/modules/programs/bash/completion.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
programs.bash.enable = true;
|
||||
|
||||
test.stubs.bash-completion = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'if [[ ! -v BASH_COMPLETION_VERSINFO ]]; then'
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
' . "@bash-completion@/etc/profile.d/bash_completion.sh"'
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'fi'
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
bash-completion = ./completion.nix;
|
||||
bash-logout = ./logout.nix;
|
||||
bash-session-variables = ./session-variables.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ with lib;
|
|||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
|
||||
logoutExtra = ''
|
||||
clear-console
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ with lib;
|
|||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
|
||||
sessionVariables = {
|
||||
V1 = "v1";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue