summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2020-11-04 20:37:50 -0500
committerTim Steinbach <tim@nequissimus.com>2020-11-04 20:37:50 -0500
commit9813539969d6071ed1a162a1d45d7521b2980c2a (patch)
tree2bddeafbfad11ac9c45a83cc3e31c283072ea909
parent9907a2d48bf10c8ab39fb5ad165d0522e837b109 (diff)
downloadnixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar.gz
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar.bz2
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar.lz
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar.xz
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.tar.zst
nixpkgs-9813539969d6071ed1a162a1d45d7521b2980c2a.zip
oh-my-zsh: Add test
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/oh-my-zsh.nix18
-rw-r--r--pkgs/shells/zsh/oh-my-zsh/default.nix2
3 files changed, 21 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 76b2af9d578..e2e9a15fc32 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -254,6 +254,7 @@ in
   novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
   nsd = handleTest ./nsd.nix {};
   nzbget = handleTest ./nzbget.nix {};
+  oh-my-zsh = handleTest ./oh-my-zsh.nix {};
   openarena = handleTest ./openarena.nix {};
   openldap = handleTest ./openldap.nix {};
   opensmtpd = handleTest ./opensmtpd.nix {};
diff --git a/nixos/tests/oh-my-zsh.nix b/nixos/tests/oh-my-zsh.nix
new file mode 100644
index 00000000000..57a073b086e
--- /dev/null
+++ b/nixos/tests/oh-my-zsh.nix
@@ -0,0 +1,18 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "oh-my-zsh";
+
+  machine = { pkgs, ... }:
+
+    {
+      programs.zsh = {
+        enable = true;
+        ohMyZsh.enable = true;
+      };
+    };
+
+  testScript = ''
+    start_all()
+    machine.succeed("touch ~/.zshrc")
+    machine.succeed("zsh -c 'source /etc/zshrc && echo $ZSH | grep oh-my-zsh-${pkgs.oh-my-zsh.version}'")
+  '';
+})
diff --git a/pkgs/shells/zsh/oh-my-zsh/default.nix b/pkgs/shells/zsh/oh-my-zsh/default.nix
index f4388f6d861..3660453245b 100644
--- a/pkgs/shells/zsh/oh-my-zsh/default.nix
+++ b/pkgs/shells/zsh/oh-my-zsh/default.nix
@@ -67,6 +67,8 @@ stdenv.mkDerivation rec {
   '';
 
   passthru = {
+    tests = { inherit (nixosTests) oh-my-zsh; };
+
     updateScript = writeScript "update.sh" ''
       #!${stdenv.shell}
       set -o errexit