mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 04:51:08 +01:00
pay-respects: add module
Add pay-respects module including shell integration support for bash, zsh, fish and nushell.
This commit is contained in:
parent
99f54cdfef
commit
db9a98e178
8 changed files with 138 additions and 0 deletions
4
tests/modules/programs/pay-respects/default.nix
Normal file
4
tests/modules/programs/pay-respects/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
pay-respects-integration-enabled = ./integration-enabled.nix;
|
||||
pay-respects-integration-disabled = ./integration-disabled.nix;
|
||||
}
|
||||
22
tests/modules/programs/pay-respects/integration-disabled.nix
Normal file
22
tests/modules/programs/pay-respects/integration-disabled.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ ... }: {
|
||||
programs = {
|
||||
pay-respects.enable = true;
|
||||
pay-respects.enableBashIntegration = false;
|
||||
pay-respects.enableFishIntegration = false;
|
||||
pay-respects.enableZshIntegration = false;
|
||||
pay-respects.enableNushellIntegration = false;
|
||||
bash.enable = true;
|
||||
zsh.enable = true;
|
||||
fish.enable = true;
|
||||
nushell.enable = true;
|
||||
};
|
||||
|
||||
test.stubs.pay-respects = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileNotRegex home-files/.bashrc '@pay-respects@/bin/dummy'
|
||||
assertFileNotRegex home-files/.zshrc '@pay-respects@/bin/dummy'
|
||||
assertFileNotRegex home-files/.config/fish/config.fish '@pay-respects@/bin/dummy'
|
||||
assertFileNotRegex home-files/.config/nushell/config.nu '@pay-respects@/bin/dummy'
|
||||
'';
|
||||
}
|
||||
33
tests/modules/programs/pay-respects/integration-enabled.nix
Normal file
33
tests/modules/programs/pay-respects/integration-enabled.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ ... }: {
|
||||
programs = {
|
||||
pay-respects.enable = true;
|
||||
bash.enable = true;
|
||||
zsh.enable = true;
|
||||
fish.enable = true;
|
||||
nushell.enable = true;
|
||||
};
|
||||
|
||||
test.stubs.pay-respects = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'eval "$(@pay-respects@/bin/dummy bash --alias)"'
|
||||
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'eval "$(@pay-respects@/bin/dummy zsh --alias)"'
|
||||
|
||||
assertFileExists home-files/.config/fish/config.fish
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
'@pay-respects@/bin/dummy fish --alias | source'
|
||||
|
||||
assertFileExists home-files/.config/nushell/config.nu
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'@pay-respects@/bin/dummy nushell --alias [<alias>]'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue