carapace: add module

This commit is contained in:
Weathercold 2023-09-03 12:09:45 +02:00 committed by Robert Helgesson
parent 886ea1d213
commit 3c0e381fef
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
9 changed files with 181 additions and 0 deletions

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

View file

@ -0,0 +1,6 @@
{
carapace-bash = ./bash.nix;
carapace-zsh = ./zsh.nix;
carapace-fish = ./fish.nix;
carapace-nushell = ./nushell.nix;
}

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

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

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