From d3d5e60e5aa593e65bd5eaf41648b60b5300f78a Mon Sep 17 00:00:00 2001
From: Artturin <Artturin@artturin.com>
Date: Thu, 30 May 2024 00:03:07 +0300
Subject: [PATCH] modules/darwin/community-builder: add a sane zsh config

Biggest benefits are better prompt and the ability to properly use arrow up
to go through the history

`nix<up>` searches through commands which start with `nix`

https://grml.org/
---
 modules/darwin/community-builder/default.nix | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/darwin/community-builder/default.nix b/modules/darwin/community-builder/default.nix
index e643cec..9627880 100644
--- a/modules/darwin/community-builder/default.nix
+++ b/modules/darwin/community-builder/default.nix
@@ -1,6 +1,16 @@
+{ pkgs, ... }:
 {
   imports = [
     ./packages.nix
     ./users.nix
   ];
+
+  programs.zsh = {
+    # https://grml.org/zsh/grmlzshrc.html
+    # https://grml.org/zsh/grml-zsh-refcard.pdf
+    interactiveShellInit = ''
+      source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
+    '';
+    promptInit = ""; # otherwise it'll override the grml prompt
+  };
 }