1
0
mirror of https://github.com/nix-community/home-manager synced 2024-07-03 03:48:31 +02:00
home-manager/tests/modules/programs/zplug/modules.nix
flexagoon 288faaa5a6
programs.zsh.zplug: add zplugHome option
Add an option to set custom `$ZPLUG_HOME`. Changing it with
`home.sessionVariables` doesnt work, since it has to be exported
before Zplug is initialised
2021-11-02 08:49:47 +01:00

53 lines
1.1 KiB
Nix

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