1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 10:49:44 +01:00
home-manager/tests/modules/programs/zplug/modules.nix

49 lines
1 KiB
Nix
Raw Normal View History

2023-07-08 10:12:35 +02:00
{ config, pkgs, ... }:
{
2023-07-08 10:12:35 +02:00
programs.zsh = {
enable = true;
zplug = {
enable = true;
2023-07-08 10:12:35 +02:00
zplugHome = pkgs.emptyDirectory;
plugins = [
{
name = "plugins/git";
tags = [ "from:oh-my-zsh" ];
}
{
name = "lib/clipboard";
tags = [ "from:oh-my-zsh" ''if:"[[ $OSTYPE == *darwin* ]]"'' ];
}
];
};
2023-07-08 10:12:35 +02:00
};
2023-07-08 10:12:35 +02:00
test.stubs = {
zplug = { };
zsh = { };
};
2023-07-08 10:12:35 +02:00
nmt.script = ''
assertFileContains home-files/.zshrc \
'source @zplug@/share/zplug/init.zsh'
2023-07-08 10:12:35 +02:00
assertFileContains home-files/.zshrc \
'zplug "plugins/git", from:oh-my-zsh'
2023-07-08 10:12:35 +02:00
assertFileContains home-files/.zshrc \
'zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"'
2023-07-08 10:12:35 +02:00
assertFileContains home-files/.zshrc \
'if ! zplug check; then
zplug install
fi'
2023-07-08 10:12:35 +02:00
assertFileRegex home-files/.zshrc \
'^zplug load$'
2023-07-08 10:12:35 +02:00
assertFileContains home-files/.zshrc \
'export ZPLUG_HOME=${config.programs.zsh.zplug.zplugHome}'
'';
}