about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorJoe DeVivo <joe@devivo.com>2023-01-11 07:22:06 -0700
committerJoe DeVivo <joe@devivo.com>2023-01-11 07:40:11 -0700
commit288a8815e07ed5f804c9e9db581ecb5c90f97753 (patch)
tree2eb0ceea4291f40325fe5ac8ee55f2efffba0aba /pkgs/shells
parentc96efc9d4487d56d5484482d751064588fc650d0 (diff)
downloadnixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar.gz
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar.bz2
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar.lz
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar.xz
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.tar.zst
nixlib-288a8815e07ed5f804c9e9db581ecb5c90f97753.zip
zimfw: init at 1.11.0
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/zsh/zimfw/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/shells/zsh/zimfw/default.nix b/pkgs/shells/zsh/zimfw/default.nix
new file mode 100644
index 000000000000..f78723ee6e2b
--- /dev/null
+++ b/pkgs/shells/zsh/zimfw/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "zimfw";
+  version = "1.11.0";
+  src = fetchFromGitHub {
+    owner = "zimfw";
+    repo = "zimfw";
+    rev = "v${version}";
+    ## zim only needs this one file to be installed.
+    sparseCheckout = [ "zimfw.zsh" ];
+    sha256 = "sha256-BmzYAgP5Z77VqcpAB49cQLNuvQX1qcKmAh9BuXsy2pA=";
+  };
+  strictDeps = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp -r $src/zimfw.zsh $out/
+
+    runHook postInstall
+  '';
+
+  ## zim automates the downloading of any plugins you specify in the `.zimrc`
+  ## file. To do that with Nix, you'll need $ZIM_HOME to be writable.
+  ## `~/.cache/zim` is a good place for that. The problem is that zim also
+  ## looks for `zimfw.zsh` there, so we're going to tell it here to look for
+  ## the `zimfw.zsh` where we currently are.
+  postFixup = ''
+    substituteInPlace $out/zimfw.zsh \
+      --replace "\''${ZIM_HOME}/zimfw.zsh" "$out/zimfw.zsh"
+  '';
+
+  meta = with lib; {
+    description =
+      "The Zsh configuration framework with blazing speed and modular extensions";
+    homepage = "https://zimfw.sh";
+    license = licenses.mit;
+    maintainers = [ maintainers.joedevivo ];
+    platforms = platforms.all;
+  };
+}