about summary refs log tree commit diff
path: root/nix/hosts/caladan
diff options
context:
space:
mode:
Diffstat (limited to 'nix/hosts/caladan')
-rw-r--r--nix/hosts/caladan/aliases.nix18
-rw-r--r--nix/hosts/caladan/darwin-configuration.nix9
-rw-r--r--nix/hosts/caladan/home_emile.nix306
-rw-r--r--nix/hosts/caladan/home_hydra.nix2
-rw-r--r--nix/hosts/caladan/session_variables.zsh6
5 files changed, 311 insertions, 30 deletions
diff --git a/nix/hosts/caladan/aliases.nix b/nix/hosts/caladan/aliases.nix
index e314f72..58c224e 100644
--- a/nix/hosts/caladan/aliases.nix
+++ b/nix/hosts/caladan/aliases.nix
@@ -1,30 +1,27 @@
 {
   ":q" = "exit";
   ls = "eza";
-  ytop = "btm";
 
   # short forms
   tf = "terraform";
-  h = "mosh hack";
 
   r2help = ''r2 -qq -c "?*~..." --'';
   mosh = "mosh --no-init";
   t = "task";
   tw = "timew";
 
-  ipa = "scutil --nwi";
+  ipa = "scutil --nwi"; # more `ip a` like info on macos
 
   # this can be super nice and super annoying at the same time:
   # ssh = "kitty +kitten ssh";
 
-  light = "kitty +kitten themes --reload-in=all Ayu Light";
-  dark = "kitty +kitten themes --reload-in=all Ayu";
-
-
   ".." = "cd ..";
   "..." = "cd ../..";
   "...." = "cd ../../..";
   "....." = "cd ../../../..";
+  "......" = "cd ../../../../..";
+  "......." = "cd ../../../../../..";
+  "........" = "cd ../../../../../../..";
 
   grep = "grep --color=auto";
   nix-stray-roots = ''
@@ -34,7 +31,7 @@
 
   servethis = "python3 -m http.server";
 
-  # nmap foo
+  # these are the oh-my-zsh nmap plugin aliases which are nice to have around imho
   nmap_open_ports = "nmap --open";
   nmap_list_interfaces = "nmap --iflist";
   nmap_slow = "sudo nmap -sS -v -T1";
@@ -50,6 +47,7 @@
   nmap_full_with_scripts = "sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " ;
   nmap_web_safe_osscan = "sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy ";
   nmap_ping_scan = "nmap -n -sP";
-  lm = "sudo kitten themes --reload-in=all 3024 Day";
-  dm = "sudo kitten themes --reload-in=all Default";
+
+  light = "sudo kitten themes --reload-in=all 3024 Day";
+  dark = "sudo kitten themes --reload-in=all Default";
 }
diff --git a/nix/hosts/caladan/darwin-configuration.nix b/nix/hosts/caladan/darwin-configuration.nix
index a181b35..2461fd2 100644
--- a/nix/hosts/caladan/darwin-configuration.nix
+++ b/nix/hosts/caladan/darwin-configuration.nix
@@ -85,17 +85,14 @@
     config.allowUnfree = true;
   };
 
-  programs.fish.enable = true;
-
   services.nix-daemon.enable = true;
 
+  # <3
   security.pam.enableSudoTouchIdAuth = true;
 
   environment = {
-    systemPackages = [
-      pkgs.yarr
-    ];
-    shells = with pkgs; [ bashInteractive zsh fish ];
+    systemPackages = [ ]; # set via home-manager
+    shells = with pkgs; [ bashInteractive zsh ];
   };
 
 }
diff --git a/nix/hosts/caladan/home_emile.nix b/nix/hosts/caladan/home_emile.nix
index f57daaf..06131dd 100644
--- a/nix/hosts/caladan/home_emile.nix
+++ b/nix/hosts/caladan/home_emile.nix
@@ -1,14 +1,17 @@
-{ pkgs, lib, stdenv, ... }:
+{ pkgs, ... }:
 
 {
   home = {
+    # The state version is required and should stay at the version you
+    # originally installed.
     stateVersion = "22.11";
     username = "emile";
     homeDirectory = "/Users/emile";
   };
 
-  # let home-manager install and manage itself
   programs = {
+
+    # let home-manager install and manage itself
     home-manager.enable = true;
 
     direnv = { 
@@ -56,8 +59,285 @@
     emacs = {
       enable = true;
       package = pkgs.emacs;
+      extraPackages = epkgs: with epkgs; [
+        nix-mode
+        magit
+        meow
+      ];
       extraConfig = ''
         (setq standard-indent 2)
+
+        ;; MELPA Packages
+        (require 'package)
+        (package-initialize)
+        (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
+        (unless package-archive-contents
+          (package-refresh-contents))
+
+        ;; Install packages.
+        (dolist (package '(use-package sly corfu org))
+          (unless (package-installed-p package)
+            (package-install package)))
+
+        (use-package org)
+
+        ;(use-package evil-colemak-basics)
+
+        (when (display-graphic-p)
+          (tool-bar-mode 0)
+          (scroll-bar-mode 0))
+        (setq inhibit-startup-screen t)
+
+        (load-theme 'leuven) ;; light theme
+
+        ;; pixel perfect scrolling
+        (setq pixel-scroll-precision-mode 1)
+
+        ;; dont create lockfiles
+        (setq create-lockfiles nil)
+
+        ;; delete excess backup version silently
+        (setq delete-old-versions -1)
+        (setq make-backup-files nil) ; stop creating ~ files
+
+        ;; use version controll
+        (setq version-control t)
+
+        ;; utf8 by default(setq coding-system-for-read 'utf-8)
+        (setq coding-system-for-write 'utf-8)
+
+        ;; org-mode
+        (require 'org)
+        (define-key global-map "\C-cl" 'org-store-link)
+        (define-key global-map "\C-ca" 'org-agenda)
+        (setq org-log-done t)
+
+        ;; random emacs foo
+        (setq-default indent-tabs-mode nil) ;; use spaces, not tabs
+        (setq show-paren-delay 0)
+        (show-paren-mode)
+
+        ;; write customizations to a custom file
+        (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
+
+        ;; Configure SBCL as the Lisp program for SLIME
+        (add-to-list 'exec-path "/Users/emile/.nix-profile/bin")
+        (defvar inerior-lisp-program "clisp")
+
+        ;; configure parinfer to be enabled as a mode when the major lisp mode is enabled
+        (add-to-list 'load-path "/Users/emile/parinfer-rust")
+        (add-hook 'emacs-lisp-mode 'parinfer-rust-mode)
+        (add-hook 'emacs-lisp-mods (lambda () (lispy-mode 1)))
+
+        (require 'meow)
+
+        (defun meow-setup ()
+          "My colemak-dh meow keybindings with some helix influence."
+          (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak-dh)
+          (meow-motion-overwrite-define-key
+           ;; Use e to move up, n to move down.
+           ;; Since special modes usually use n to move down, we only overwrite e here.
+           '("e" . meow-prev)
+           '("<escape>" . ignore))
+          (meow-leader-define-key
+           '("?" . meow-cheatsheet)
+           ;; To execute the originally e in MOTION state, use SPC e.
+           '("e" . "H-e")
+           '("1" . meow-digit-argument)
+           '("2" . meow-digit-argument)
+           '("3" . meow-digit-argument)
+           '("4" . meow-digit-argument)
+           '("5" . meow-digit-argument)
+           '("6" . meow-digit-argument)
+           '("7" . meow-digit-argument)
+           '("8" . meow-digit-argument)
+           '("9" . meow-digit-argument)
+           '("0" . meow-digit-argument))
+          (meow-normal-define-key
+           '("0" . meow-expand-0)
+           '("1" . meow-expand-1)
+           '("2" . meow-expand-2)
+           '("3" . meow-expand-3)
+           '("4" . meow-expand-4)
+           '("5" . meow-expand-5)
+           '("6" . meow-expand-6)
+           '("7" . meow-expand-7)
+           '("8" . meow-expand-8)
+           '("9" . meow-expand-9)
+           '("-" . negative-argument)
+           '(";" . meow-reverse)
+           '("," . meow-inner-of-thing)
+           '("." . meow-bounds-of-thing)
+           '("[" . meow-beginning-of-thing)
+           '("]" . meow-end-of-thing)
+           '("/" . meow-visit)
+           '("a" . meow-append)
+           '("A" . meow-open-below)
+           '("b" . meow-back-word)
+           '("B" . meow-back-symbol)
+           '("c" . meow-change)
+           ; '("C" . )
+           '("d" . meow-delete)
+           ;'("D" . delete-window)
+           '("e" . meow-next)
+           '("E" . meow-next-expand)
+           '("f" . find-file)
+           '("F" . flycheck-list-errors)
+           '("g" . meow-cancel-selection)
+           '("G" . meow-grab)
+           '("h" . meow-mark-word)
+           '("H" . meow-mark-symbol)
+           '("i" . meow-prev)
+           '("I" . meow-prev-expand)
+           '("j" . meow-join)
+           ; '("J" . )
+           '("k" . meow-kill)
+           '("K" . meow-paren-mode)
+           '("l" . meow-line)
+           '("L" . meow-goto-line)
+           '("m" . meow-block)
+           '("M" . meow-to-block)
+           '("n" . meow-left)
+           '("N" . meow-left-expand)
+           '("o" . meow-right)
+           '("O" . meow-right-expand)
+           '("p" . meow-yank)
+           ; '("P" . )
+           '("q" . meow-quit)
+           ; '("Q" . )
+           '("r" . meow-replace)
+           '("R" . undo-redo)
+           '("s" . meow-insert)
+           '("S" . meow-open-above)
+           '("t" . meow-till)
+           ; '("T" . )
+           '("u" . meow-undo)
+           '("U" . meow-undo-in-selection)
+           '("v" . meow-search)
+           '("w" . meow-next-word)
+           '("W" . meow-next-symbol)
+           '("x" . meow-delete)
+           '("X" . meow-backward-delete)
+           '("y" . meow-save)
+           '("z" . meow-pop-selection)
+           ; '("Z" . )
+           '("'" . repeat)
+           '("<escape>" . ignore)))
+
+
+        (meow-setup)
+        (meow-global-mode 1)
+
+        ;; Corfu completion
+        (use-package corfu
+          :custom
+          (corfu-cycle-tab t)
+          (corfu-auto t)
+          (corfu-auto-prefix 2)
+          (corfu-auto-delay 0.0)
+          (corfu-quit-at-boundary 'separator)
+          (corfu-echo-documentation 0.5)
+          (corfu-preview-current 'insert)
+          (corfu-preselect 'prompt)
+          :bind (:map corfu-map
+                      ("M-SPC" . corfu-insert-separator)
+                      ("RET" . nil)
+                      ("TAB" . corfu-next)
+                      ([tab] . corfu-next)
+                      ("S-TAB" . corfu-previous)
+                      ([backtab] . corfu-previous)
+                      ("S-<return>" . corfu-inser))
+          :init
+          (global-corfu-mode)
+          (corfu-history-mode)
+
+          :config
+          (add-hook 'eshell-mode-hook
+                    (lambda ()
+                      (setq-local corfu-quit-at-boundary t
+                                  corfu-quit-no-match t
+                                  corfu-auto nil)
+                      (corfu-mode))))
+
+        ;; In-margin annotations
+        (use-package marginalia
+          :custom
+          (marginalia-max-relative-age 0)
+          (marginalia-align 'right)
+          :init
+          (marginalia-mode))
+
+        ;; Fancy icons
+        (use-package all-the-icons-completion
+          :after (marginalia all-the-icons)
+          :hook (marginalia . all-the-icons-completion-marginalia-setup)
+          :init (all-the-icons-completion-mode))
+
+        ;; Usable minibuffers
+        (use-package vertico
+          :init (vertico-mode)
+          :custom (vertico-count 13)
+          (vertico-resize t)
+          (vertico-cycle nil)
+          :config (vertico-mode))
+
+        ;; orderless completion
+        ;; This allows searching for space separated terms in any order
+        (use-package orderless
+          :init (setq completion-styles '(orderless basic)
+                      completion-category-defaults nil
+                      completion-category-overrides '((file (styles partial-completion)))
+                      ))
+
+        ;; general purpose emacs settings
+        (use-package emacs
+          :init
+
+          ;; do not allow cursor in the minibuffer prompt
+          (setq minibuffer-prompt-properties
+                '(read-only t cursor-intangible t face minibuffer-prompt))
+          (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
+
+          ;; support opening new minibuffers from inside existing minibuffers
+          (setq enable-recursive-minibuffers t)
+
+          ;; Emacs 28 and newer: Hide commands in M-x which do not work in the current
+          ;; mode. Vertico commands are hidden in normal buffers. This setting is
+          ;; useful beyond Vertico.
+          (setq read-extended-command-predicate #'command-completion-default-include-p))
+
+        ;; Add "lisp" to the list of languages babel is allowed to eval
+        ;(setq-default org-babel-lisp-eval-fn #'sly-eval)
+        (org-babel-do-load-languages
+         'org-babel-load-languages
+         '((lisp . t)))
+
+        ;; markdown mode
+        (use-package markdown-mode
+          :ensure t
+          :mode ("README\\.md\\'" . gfm-mode)
+          :init (setq markdown-command "multimarkdown"))
+
+        ;; minibuffer with help when waiting too long
+        (use-package which-key
+          :ensure t
+          :config
+          (setq which-key-idle-delay 0.1)
+          (setq which-key-idle-secondary-delay 0.1)
+          (which-key-mode))
+
+        ;; Display imenu (symbols) in a separate buffer
+        (use-package imenu-list :ensure t
+          :init
+          (setq imenu-list-auto-resize t)
+          (setq imenu-list-focus-after-activation t))
+
+        ;; error checking
+        (use-package flycheck
+          :ensure t
+          :init (global-flycheck-mode))
+
+        (provide '.emacs)                       ; makes flycheck happy
       '';
     };
 
@@ -103,7 +383,7 @@
         "cmd+shift+k" = "move_window up";
         "cmd+shift+l" = "move_window right";
 
-        "cmd+shift+m" = "detach_window ask";
+        # "cmd+shift+m" = "detach_window ask";
 
         "command+j" = "kitten pass_keys.py neighboring_window bottom command+j";
         "command+k" = "kitten pass_keys.py neighboring_window top    command+k";
@@ -112,14 +392,14 @@
         "command+b" = "combine : clear_terminal scroll active : send_text normal,application \x0c";
 
         # "ctrl+n" = "send_text all \x0e";
-        "ctrl+e" = "send_text all \x01h";
-        "ctrl+n" = "send_text all \x01i";
-        "ctrlshift++n" = "send_text all \x01i";
-
-        "ctrl+left" = "resize_window wider";
-        "ctrl+right" = "resize_window narrower";
-        "ctrl+up" = "resize_window shorter";
-        "ctrl+down" = "resize_window taller";
+        # "ctrl+e" = "send_text all \x01h";
+        # "ctrl+n" = "send_text all \x01i";
+        # "ctrlshift++n" = "send_text all \x01i";
+
+        # "ctrl+left" = "resize_window wider";
+        # "ctrl+right" = "resize_window narrower";
+        # "ctrl+up" = "resize_window shorter";
+        # "ctrl+down" = "resize_window taller";
       };
 
       environment = { };
@@ -193,6 +473,10 @@
 
     tiny # irc
 
+    rlwrap
+
+    entr
+
     # blender
 
   # ] ++ lib.optionals stdenv.isDarwin [
diff --git a/nix/hosts/caladan/home_hydra.nix b/nix/hosts/caladan/home_hydra.nix
index 25686da..1161d9a 100644
--- a/nix/hosts/caladan/home_hydra.nix
+++ b/nix/hosts/caladan/home_hydra.nix
@@ -7,8 +7,8 @@
   homeDirectory = "/Users/hydra";
  };
 
- # let home-manager install and manage itself
  programs = {
+  # let home-manager install and manage itself
   home-manager.enable = true;
  };
 
diff --git a/nix/hosts/caladan/session_variables.zsh b/nix/hosts/caladan/session_variables.zsh
index 05badcd..6f850c8 100644
--- a/nix/hosts/caladan/session_variables.zsh
+++ b/nix/hosts/caladan/session_variables.zsh
@@ -6,8 +6,10 @@ export PROMPT="; "		# minimal prompt
 #export RPROMPT="%F{green}%/%F{reset}"
 export RPROMPT="%F{green}%/%F{reset} %D{%K:%M:%S}" 
 
-# reset the prompt, so we get the time the command was executed
-# in the rprompt
+# Reset the prompt, so we get the time the command was executed
+# in the rprompt. A single second was to much, as it also breaks all the
+# prompt suggestions, 5 seconds seems quite sensible, and you can just hit
+# `TAB` yet another time if you want to see the suggestions again
 TMOUT=5
 TRAPALRM() {
   zle reset-prompt