bash: support bash completion

This commit is contained in:
Robert Helgesson 2022-08-07 13:10:13 +02:00
parent d9e03b7f8c
commit f5e9879e74
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
6 changed files with 60 additions and 1 deletions

View 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'
'';
}