home-manager/tests/modules/programs/zplug/modules.nix
s1341 1b210e7143
zplug: add module
This adds initial support for the zsh package manager "zplug".

PR #1105
2020-06-14 15:12:49 +02:00

49 lines
1.1 KiB
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* ]]"'' ];
}
];
};
};
nixpkgs.overlays = [
(self: super: {
zsh = pkgs.writeScriptBin "dummy-zsh" "";
zplug = pkgs.writeScriptBin "dummy-zplug" "";
})
];
nmt.script = ''
assertFileRegex home-files/.zshrc \
'^source ${builtins.storeDir}/.*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* ]]"'
assertFileRegex home-files/.zshrc \
'^zplug install$'
assertFileRegex home-files/.zshrc \
'^zplug load$'
'';
};
}