mirror of
https://github.com/nix-community/home-manager
synced 2024-12-29 13:19:47 +01:00
1a6d6b8ace
Running `zplug install` will always product output, even if there is nothing to do. Gating it behind a `zplug check` eliminates that output when there is nothing to do, and is recommended in the zplug README.
50 lines
1.1 KiB
Nix
50 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* ]]"'
|
|
|
|
assertFileContains home-files/.zshrc \
|
|
'if ! zplug check; then
|
|
zplug install
|
|
fi'
|
|
|
|
assertFileRegex home-files/.zshrc \
|
|
'^zplug load$'
|
|
'';
|
|
};
|
|
}
|