2023-07-08 10:12:35 +02:00
|
|
|
{ config, pkgs, ... }:
|
2020-03-20 11:02:58 +01:00
|
|
|
|
|
|
|
{
|
2023-07-08 10:12:35 +02:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
zplug = {
|
2020-03-20 11:02:58 +01:00
|
|
|
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* ]]"'' ];
|
|
|
|
}
|
|
|
|
];
|
2020-03-20 11:02:58 +01:00
|
|
|
};
|
2023-07-08 10:12:35 +02:00
|
|
|
};
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
test.stubs = {
|
|
|
|
zplug = { };
|
|
|
|
zsh = { };
|
|
|
|
};
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
nmt.script = ''
|
|
|
|
assertFileContains home-files/.zshrc \
|
|
|
|
'source @zplug@/share/zplug/init.zsh'
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
assertFileContains home-files/.zshrc \
|
|
|
|
'zplug "plugins/git", from:oh-my-zsh'
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
assertFileContains home-files/.zshrc \
|
|
|
|
'zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"'
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
assertFileContains home-files/.zshrc \
|
|
|
|
'if ! zplug check; then
|
|
|
|
zplug install
|
|
|
|
fi'
|
2020-03-20 11:02:58 +01:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
assertFileRegex home-files/.zshrc \
|
|
|
|
'^zplug load$'
|
2021-10-16 23:35:03 +02:00
|
|
|
|
2023-07-08 10:12:35 +02:00
|
|
|
assertFileContains home-files/.zshrc \
|
|
|
|
'export ZPLUG_HOME=${config.programs.zsh.zplug.zplugHome}'
|
|
|
|
'';
|
2020-03-20 11:02:58 +01:00
|
|
|
}
|