mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 14:28:15 +00:00
granted: support fish shell (#6549)
Due to fish being a non-POSIX shell, granted provides a separate wrapper to be used by fish.
This commit is contained in:
parent
04c915bcf1
commit
83f4629364
6 changed files with 34 additions and 2 deletions
|
@ -15,6 +15,9 @@ in {
|
||||||
|
|
||||||
enableZshIntegration =
|
enableZshIntegration =
|
||||||
lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||||
|
|
||||||
|
enableFishIntegration =
|
||||||
|
lib.hm.shell.mkFishIntegrationOption { inherit config; };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -27,5 +30,11 @@ in {
|
||||||
unset GRANTED_ALIAS_CONFIGURED
|
unset GRANTED_ALIAS_CONFIGURED
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
programs.fish.functions.assume = mkIf cfg.enableFishIntegration ''
|
||||||
|
set -x GRANTED_ALIAS_CONFIGURED "true"
|
||||||
|
source ${package}/share/assume.fish
|
||||||
|
set -e GRANTED_ALIAS_CONFIGURED
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
granted-integration-enabled = ./integration-enabled.nix;
|
granted-zsh-integration-enabled = ./zsh-integration-enabled.nix;
|
||||||
granted-integration-disabled = ./integration-disabled.nix;
|
granted-zsh-integration-disabled = ./zsh-integration-disabled.nix;
|
||||||
|
granted-fish-integration-enabled = ./fish-integration-enabled.nix;
|
||||||
|
granted-fish-integration-disabled = ./fish-integration-disabled.nix;
|
||||||
}
|
}
|
||||||
|
|
11
tests/modules/programs/granted/fish-integration-disabled.nix
Normal file
11
tests/modules/programs/granted/fish-integration-disabled.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
granted.enable = true;
|
||||||
|
granted.enableFishIntegration = false;
|
||||||
|
fish.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertPathNotExists home-files/.config/fish/functions/assume.fish
|
||||||
|
'';
|
||||||
|
}
|
10
tests/modules/programs/granted/fish-integration-enabled.nix
Normal file
10
tests/modules/programs/granted/fish-integration-enabled.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
granted.enable = true;
|
||||||
|
fish.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/fish/functions/assume.fish
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue