cb09a968e9
This option provides a more convenient way to overlay dummy packages. It also adds a function `config.lib.test.mkStubPackage` that can, e.g., be used for `package` options.
49 lines
996 B
Nix
49 lines
996 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
programs.zsh = {
|
|
enable = true;
|
|
zplug = {
|
|
enable = true;
|
|
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$'
|
|
'';
|
|
};
|
|
}
|