diff options
author | Kaiden Fey <kookie@spacekookie.de> | 2020-09-21 14:12:32 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-09-21 14:12:32 +0200 |
commit | f80843dd45d7acd563d0a5b014cec3a2ea686fc2 (patch) | |
tree | 87189d873d6f932d85f9c1a480462b37d96cd6a5 /home-manager/tests/modules/programs/zplug/modules.nix | |
parent | e0800985dab8f8ebb4cebdfd7e361fd1fafdb2a7 (diff) | |
parent | 9b1b55ba0264a55add4b7b4e022bdc2832b531f6 (diff) |
Merge commit '9b1b55ba0264a55add4b7b4e022bdc2832b531f6'
Diffstat (limited to 'home-manager/tests/modules/programs/zplug/modules.nix')
-rw-r--r-- | home-manager/tests/modules/programs/zplug/modules.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/home-manager/tests/modules/programs/zplug/modules.nix b/home-manager/tests/modules/programs/zplug/modules.nix new file mode 100644 index 00000000000..704c5c5e2ef --- /dev/null +++ b/home-manager/tests/modules/programs/zplug/modules.nix @@ -0,0 +1,50 @@ +{ 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$' + ''; + }; +} |