summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el8
-rw-r--r--user/marvin.nix45
-rw-r--r--user/settings/darwin.nix13
-rw-r--r--user/settings/development/base.nix6
-rw-r--r--user/settings/emacs.nix2
-rw-r--r--user/settings/kitty.nix33
-rw-r--r--user/settings/user-interface.nix2
7 files changed, 86 insertions, 23 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 56a437bb..037f8385 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -31,6 +31,8 @@
   (interactive)
   (load-file user-init-file))
 
+(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
+
 (setq use-package-enable-imenu-support t)
 (require 'use-package)
 (setq use-package-always-demand (daemonp)
@@ -788,6 +790,12 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
   :general (:keymaps 'comint-mode-map
                      "C-c C-l" #'counsel-shell-history))
 
+(use-package chatgpt-shell
+  :defer 5
+  :config (progn
+            (chatgpt-shell-ollama-load-models :override t)
+            (setq chatgpt-shell-model-version "llama3.3")))
+
 ;;; Editing
 
 (setq-default tab-always-indent 'complete
diff --git a/user/marvin.nix b/user/marvin.nix
index 41cab689..f6a745c6 100644
--- a/user/marvin.nix
+++ b/user/marvin.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }: {
+{ config, pkgs, ... }: {
   imports = [
     ./settings/base.nix
     ./settings/development/base.nix
@@ -9,7 +9,6 @@
     ./settings/emacs.nix
     ./settings/fish.nix
     ./settings/git.nix
-    ./settings/kitty.nix
     ./settings/nixpkgs.nix
     ./settings/ssh.nix
     ./settings/tabnine.nix
@@ -20,24 +19,56 @@
   home.username = "alan";
   home.homeDirectory = "/Users/alan";
   home.stateVersion = "22.11";
-  home.sessionPath = [
-    "$HOME/.cache/lm-studio/bin"
-  ];
   home.packages = with pkgs; [
     picocom
+    ollama
   ];
 
+  launchd.agents = {
+    ollama = {
+      enable = true;
+      config = {
+        ProgramArguments = [ "/Users/alan/.local/state/nix/profile/bin/ollama" "serve" ];
+        RunAtLoad = true;
+        KeepAlive = true;
+        WorkingDirectory = "/Users/alan";
+        EnvironmentVariables = {
+          OLLAMA_HOST = "[::]:11434";
+          OLLAMA_KEEP_ALIVE = "-1"; # keep models in memory forever
+          OLLAMA_FLASH_ATTENTION = "1"; # significantly reduce memory usage as the context size grows
+        };
+      };
+    };
+    ollama-preload = {
+      enable = true;
+      config = {
+        ProgramArguments = [
+          "/Users/alan/.local/state/nix/profile/bin/ollama"
+          "run"
+          "llama3.3"
+          ""
+        ];
+        RunAtLoad = true;
+        KeepAlive = false;
+        WorkingDirectory = "/Users/alan";
+      };
+    };
+  };
+
   launchd.agents.colima = {
     enable = true;
     config = {
-      ProgramArguments = [ "${pkgs.colima}/bin/colima" "start" ];
+      ProgramArguments = [ "/Users/alan/.local/state/nix/profile/bin/colima" "start" ];
       RunAtLoad = true;
       # It doesn't run in the foreground, yet...
       # KeepAlive = true;
       WorkingDirectory = "/Users/alan";
       StandardOutPath = "/Users/alan/Library/Logs/colima.log";
       StandardErrorPath = "/Users/alan/Library/Logs/colima.log";
-      EnvironmentVariables.HOME = "/Users/alan";
+      EnvironmentVariables = {
+        HOME = "/Users/alan";
+        XDG_CONFIG_HOME = config.xdg.configHome;
+      };
     };
   };
 
diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix
index 1ea3d470..1c0f6a74 100644
--- a/user/settings/darwin.nix
+++ b/user/settings/darwin.nix
@@ -66,6 +66,7 @@
               (
                 pkgs.writeShellScript
                   "toggle-dark-light-mode"
+                  (
                   ''
                     wait4path /nix
                     if defaults read -g AppleInterfaceStyle &>/dev/null ; then
@@ -74,7 +75,6 @@
                       MODE="light"
                     fi
                     emacsclient="${config.programs.emacs.finalPackage}/bin/emacsclient"
-                    kitty="${pkgs.kitty}/bin/kitty +kitten themes --config-file-name=theme.conf --reload-in=all --cache-age=-1"
                     emacsSwitchTheme () {
                       if pgrep -q Emacs; then
                         if [[  $MODE == "dark"  ]]; then
@@ -88,18 +88,9 @@
                         fi
                       fi
                     }
-                    kittySwitchTheme () {
-                      if pgrep -q kitty; then
-                        if [[  $MODE == "dark"  ]]; then
-                          $kitty 'Modus Vivendi'
-                        elif [[ $MODE == "light" ]]; then
-                          $kitty 'Modus Operandi'
-                        fi
-                      fi
-                    }
                     emacsSwitchTheme
-                    kittySwitchTheme
                   ''
+                  )
               )
           )
         ];
diff --git a/user/settings/development/base.nix b/user/settings/development/base.nix
index b0d23147..a454bc11 100644
--- a/user/settings/development/base.nix
+++ b/user/settings/development/base.nix
@@ -27,17 +27,17 @@
       watchexec
       entr
 
+      litecli
+
       diffoscopeMinimal
 
       skopeo
       docker-credential-helpers
       dive
-    ] ++ (if stdenv.isDarwin then [
+    ] ++ (lib.optionals stdenv.isDarwin [
       lima
       colima
       docker-client
-    ] else [
-      httping
     ]);
 
   home.sessionVariables = {
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 73a3b55a..f0a0a0ee 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -74,6 +74,7 @@ in
         cape
         clojure-mode
         cask-mode
+        chatgpt-shell
         corfu
         consult
         consult-dir
@@ -156,6 +157,7 @@ in
         treemacs-nerd-icons
         treesit-grammars.with-all-grammars
         treesit-auto
+        try
         vc-msg
         vertico
         vertico-prescient
diff --git a/user/settings/kitty.nix b/user/settings/kitty.nix
index 8a06a820..c80c5fbd 100644
--- a/user/settings/kitty.nix
+++ b/user/settings/kitty.nix
@@ -1,4 +1,5 @@
-{ pkgs
+{ config
+, pkgs
 , ...
 }:
 {
@@ -24,4 +25,34 @@
       include ~/.config/kitty/theme.conf
     '';
   };
+  launchd.agents.kitty-dark-light = {
+    enable = true;
+    config = {
+      WatchPaths = [ "${config.home.homeDirectory}/Library/Preferences/.GlobalPreferences.plist" ];
+      StandardOutputPath = "/dev/null";
+      StandardErrorPath = "/dev/null";
+      RunAtLoad = true;
+      KeepAlive = false;
+      ProgramArguments = [
+        "/bin/sh"
+        (toString (pkgs.writeShellScript "toggle-dark-light-mode" ''
+          wait4path /nix
+          if defaults read -g AppleInterfaceStyle &>/dev/null ; then
+            MODE="dark"
+          else
+            MODE="light"
+          fi
+          kitty="${pkgs.kitty}/bin/kitty +kitten themes --config-file-name=theme.conf --reload-in=all --cache-age=-1"
+          if pgrep -q kitty; then
+            if [[  $MODE == "dark"  ]]; then
+              $kitty 'Modus Vivendi'
+            elif [[ $MODE == "light" ]]; then
+              $kitty 'Modus Operandi'
+            fi
+          fi
+        ''
+        ))
+      ];
+    };
+  };
 }
diff --git a/user/settings/user-interface.nix b/user/settings/user-interface.nix
index 0bf59af9..70c9392e 100644
--- a/user/settings/user-interface.nix
+++ b/user/settings/user-interface.nix
@@ -7,7 +7,7 @@ let
 in
 {
   imports = [
-    ./kitty.nix
+    # ./kitty.nix
   ];
 
   services.ssh-agent = {