carapace: add module
This commit is contained in:
parent
886ea1d213
commit
3c0e381fef
9 changed files with 181 additions and 0 deletions
14
tests/modules/programs/carapace/bash.nix
Normal file
14
tests/modules/programs/carapace/bash.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
carapace.enable = true;
|
||||
bash.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
assertFileRegex home-files/.bashrc \
|
||||
'source <(/nix/store/.*carapace.*/bin/carapace _carapace bash)'
|
||||
'';
|
||||
}
|
||||
6
tests/modules/programs/carapace/default.nix
Normal file
6
tests/modules/programs/carapace/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
carapace-bash = ./bash.nix;
|
||||
carapace-zsh = ./zsh.nix;
|
||||
carapace-fish = ./fish.nix;
|
||||
carapace-nushell = ./nushell.nix;
|
||||
}
|
||||
18
tests/modules/programs/carapace/fish.nix
Normal file
18
tests/modules/programs/carapace/fish.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
carapace.enable = true;
|
||||
fish.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/fish/config.fish
|
||||
assertFileRegex home-files/.config/fish/config.fish \
|
||||
'/nix/store/.*carapace.*/bin/carapace _carapace fish \| source'
|
||||
|
||||
# Check whether completions are overridden.
|
||||
assertFileExists home-files/.config/fish/completions/git.fish
|
||||
assertFileContent home-files/.config/fish/completions/git.fish /dev/null
|
||||
'';
|
||||
}
|
||||
22
tests/modules/programs/carapace/nushell.nix
Normal file
22
tests/modules/programs/carapace/nushell.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
carapace.enable = true;
|
||||
nushell.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = let
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
"home-files/Library/Application Support/nushell"
|
||||
else
|
||||
"home-files/.config/nushell";
|
||||
in ''
|
||||
assertFileExists "${configDir}/env.nu"
|
||||
assertFileRegex "${configDir}/env.nu" \
|
||||
'/nix/store/.*carapace.*/bin/carapace _carapace nushell \| save -f \$"(\$carapace_cache)/init\.nu"'
|
||||
assertFileExists "${configDir}/config.nu"
|
||||
assertFileRegex "${configDir}/config.nu" \
|
||||
'source /.*/\.cache/carapace/init\.nu'
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/carapace/zsh.nix
Normal file
14
tests/modules/programs/carapace/zsh.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
carapace.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileRegex home-files/.zshrc \
|
||||
'source <(/nix/store/.*carapace.*/bin/carapace _carapace zsh)'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue