aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/programs
diff options
context:
space:
mode:
authors1341 <github@shmarya.net>2020-03-20 12:02:58 +0200
committerRobert Helgesson <robert@rycee.net>2020-06-14 15:12:49 +0200
commit1b210e7143547ce0f41e8082b8d27e9c7d220351 (patch)
tree50e5f227b67efba665d4c93b14813b7f3ddf363f /tests/modules/programs
parentbb567e20b3827eecd40d2c0d2bc9902b54ee7ac7 (diff)
zplug: add module
This adds initial support for the zsh package manager "zplug". PR #1105
Diffstat (limited to 'tests/modules/programs')
-rw-r--r--tests/modules/programs/zplug/default.nix1
-rw-r--r--tests/modules/programs/zplug/modules.nix48
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/modules/programs/zplug/default.nix b/tests/modules/programs/zplug/default.nix
new file mode 100644
index 00000000000..172f7cd5981
--- /dev/null
+++ b/tests/modules/programs/zplug/default.nix
@@ -0,0 +1 @@
+{ zplug-modules = ./modules.nix; }
diff --git a/tests/modules/programs/zplug/modules.nix b/tests/modules/programs/zplug/modules.nix
new file mode 100644
index 00000000000..8ebf82b861f
--- /dev/null
+++ b/tests/modules/programs/zplug/modules.nix
@@ -0,0 +1,48 @@
+{ 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$'
+ '';
+ };
+}