Compare commits
7
Commits
f809a8ec7b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f4690bba0 | ||
|
|
80ca830bf8 | ||
|
|
b9913d968b | ||
|
|
fa1d71b9b2 | ||
|
|
14e3db75bc | ||
|
|
b6958b91bc | ||
|
|
3d4ee3687f |
No files matched your search
+2
-1
@@ -1,4 +1,5 @@
|
||||
;; Disable package.el in favor of straight.el
|
||||
;; -*- lexical-binding: t; -*-
|
||||
;; Disable package.el in favor of elpaca
|
||||
(setq package-enable-at-startup nil)
|
||||
|
||||
(setq gc-cons-threshold most-positive-fixnum)
|
||||
|
||||
+76
-5
@@ -1,3 +1,4 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
;;; Preamble
|
||||
;; Suppress native compilation warnings
|
||||
(setq native-comp-async-report-warnings-errors nil)
|
||||
@@ -297,6 +298,9 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
:init
|
||||
(vertico-mode)
|
||||
(vertico-multiform-mode 1)
|
||||
;; Preserve project.el's most-recently-used order in the project chooser.
|
||||
(add-to-list 'vertico-multiform-commands
|
||||
'(project-switch-project (vertico-sort-function . nil)))
|
||||
(add-to-list 'vertico-multiform-categories
|
||||
'(jinx grid (vertico-grid-annotate . 20))))
|
||||
|
||||
@@ -473,9 +477,9 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
:ensure t)
|
||||
;;;; Window size
|
||||
(modify-all-frames-parameters '((alpha 99 99)
|
||||
(top . 50)
|
||||
(left . 100)
|
||||
(width . 190)
|
||||
(top . 20)
|
||||
(left . 20)
|
||||
(width . 185)
|
||||
(height . 60)))
|
||||
|
||||
;;;; Fonts
|
||||
@@ -550,14 +554,16 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
"\\*Flycheck errors\\*"
|
||||
help-mode
|
||||
compilation-mode
|
||||
"\\`\\*gd-tmux\\*\\'"
|
||||
"eshell-popup\\*$"))
|
||||
|
||||
(defun my/popper-window-height (window)
|
||||
"Resize eshell popups to half the frame height; fit other popups."
|
||||
"Resize terminal popups to half the frame height; fit other popups."
|
||||
(let ((buffer (window-buffer window)))
|
||||
(if (with-current-buffer buffer
|
||||
;; Eshell displays a new buffer before enabling `eshell-mode'.
|
||||
(or (derived-mode-p 'eshell-mode)
|
||||
(equal (buffer-name) "*gd-tmux*")
|
||||
(string-match-p "eshell-popup\\*$" (buffer-name))))
|
||||
;; A functional `window-height' action must resize the window.
|
||||
(let ((height (/ (frame-height (window-frame window)) 2)))
|
||||
@@ -655,14 +661,36 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
;;;; Project
|
||||
(use-package project
|
||||
:custom
|
||||
(project-prompter #'my/project-prompt)
|
||||
(project-switch-commands
|
||||
'((project-find-file "Find file")
|
||||
(consult-ripgrep "Ripgrep")
|
||||
(magit-status "Magit" ?m)
|
||||
(project-eshell "Eshell")
|
||||
(project-any-command "Other")))
|
||||
:config
|
||||
;; Make project.el recognize directories with a .project file as project roots
|
||||
(add-to-list 'project-vc-extra-root-markers ".project"))
|
||||
(add-to-list 'project-vc-extra-root-markers ".project")
|
||||
|
||||
(defcustom my/project-search-path '("~/Projects/")
|
||||
"Directories whose immediate children are scanned for projects."
|
||||
:type '(repeat directory)
|
||||
:group 'project)
|
||||
|
||||
(defun my/project-refresh ()
|
||||
"Remember recognized projects directly under `my/project-search-path'."
|
||||
(interactive)
|
||||
(dolist (directory my/project-search-path)
|
||||
(let ((directory (expand-file-name directory)))
|
||||
(when (file-directory-p directory)
|
||||
(project-remember-projects-under directory)))))
|
||||
|
||||
(defun my/project-prompt (&optional prompt predicate require-known)
|
||||
"Refresh known projects, then prompt using the standard project chooser.
|
||||
Pass PROMPT, PREDICATE and REQUIRE-KNOWN through to the chooser."
|
||||
(let ((inhibit-message t))
|
||||
(my/project-refresh))
|
||||
(project-prompt-project-dir prompt predicate require-known)))
|
||||
|
||||
;;;; hl-todo
|
||||
(use-package hl-todo
|
||||
@@ -854,6 +882,16 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
|
||||
("C-j" . nil)))
|
||||
|
||||
;;; Programming
|
||||
;;;; Agent-shell (Codex)
|
||||
(use-package agent-shell
|
||||
:ensure t
|
||||
:bind (("C-c a" . agent-shell))
|
||||
:custom
|
||||
(agent-shell-preferred-agent-config 'codex)
|
||||
:config
|
||||
(setq agent-shell-openai-authentication
|
||||
(agent-shell-openai-make-authentication :login t)))
|
||||
|
||||
;;;; Treesitter
|
||||
(use-package treesit-auto
|
||||
:ensure t
|
||||
@@ -1127,15 +1165,48 @@ any directory proffered by `consult-dir'."
|
||||
;;;; Eat
|
||||
(use-package eat
|
||||
:ensure t
|
||||
:bind (("C-o g" . my/gd-tmux-toggle))
|
||||
:custom
|
||||
(eat-term-name "xterm-256color")
|
||||
:init
|
||||
(defun my/gd-tmux-toggle ()
|
||||
"Show or hide the tmux terminal on gd.
|
||||
Connect the Tubnix tunnel in WireGuard first. Hiding the popup keeps
|
||||
SSH alive; opening it after SSH exits reconnects to the existing tmux
|
||||
session. With multiple sessions, tmux chooses its default session."
|
||||
(interactive)
|
||||
(if-let* ((window (get-buffer-window "*gd-tmux*")))
|
||||
(quit-window nil window)
|
||||
(require 'eat)
|
||||
;; Always launch local SSH, even when called from a TRAMP buffer.
|
||||
(let* ((default-directory (expand-file-name "~/"))
|
||||
(buffer (eat-make "gd-tmux" "ssh" nil
|
||||
"-t" "-o" "ConnectTimeout=10"
|
||||
"-o" "ServerAliveInterval=15"
|
||||
"-o" "ServerAliveCountMax=3"
|
||||
"gd" "tmux attach-session")))
|
||||
(with-current-buffer buffer
|
||||
(use-local-map (copy-keymap (current-local-map)))
|
||||
(local-set-key (kbd "q") #'quit-window)
|
||||
;; Eat's input modes take precedence over the major-mode map.
|
||||
(dolist (mode '(eat--semi-char-mode eat--char-mode))
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map (alist-get mode minor-mode-map-alist))
|
||||
(define-key map (kbd "q") #'quit-window)
|
||||
(setq-local minor-mode-overriding-map-alist
|
||||
(cons (cons mode map)
|
||||
(assq-delete-all
|
||||
mode minor-mode-overriding-map-alist))))))
|
||||
(pop-to-buffer buffer))))
|
||||
|
||||
(eval-after-load 'eshell #'eat-eshell-mode)
|
||||
(eval-after-load 'eshell #'eat-eshell-visual-command-mode)
|
||||
:config
|
||||
(defun advise-eat-keymap (map)
|
||||
(define-key map [?\C-o] nil)
|
||||
(define-key map (vector meta-prefix-char ?`) nil)
|
||||
;; Let Popper dismiss terminal windows without sending M-o remotely.
|
||||
(define-key map (vector meta-prefix-char ?o) nil)
|
||||
(define-key map [S-v] #'eat-yank))
|
||||
|
||||
(define-advice eat-eshell-semi-char-mode
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
pkgsForSystem = (system: import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [ (import ./overlays/codex-acp.nix) ];
|
||||
});
|
||||
|
||||
mkHomeConfig = ({system, username ? "ttm" }: home-manager.lib.homeManagerConfiguration {
|
||||
@@ -34,6 +35,7 @@
|
||||
});
|
||||
in
|
||||
utils.lib.eachDefaultSystem (system: {
|
||||
packages.codex-acp = (pkgsForSystem system).codex-acp;
|
||||
legacyPackages.homeConfigurations.std = mkHomeConfig { inherit system; };
|
||||
});
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
sops
|
||||
just
|
||||
codex
|
||||
codex-acp
|
||||
];
|
||||
|
||||
imports = [
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
final: prev: {
|
||||
codex-acp = final.callPackage ../packages/codex-acp.nix { };
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{ lib, buildNpmPackage, fetchFromGitHub }:
|
||||
|
||||
# The nixpkgs package still builds the Rust adapter. Version 1.x uses Node
|
||||
# and ships a compatible Codex CLI through its locked npm dependencies.
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "codex-acp";
|
||||
version = "1.10.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "agentclientprotocol";
|
||||
repo = "codex-acp";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-D8uYd30NRXQYUSBFCi66Oq0iRZXpl8P7nWv2m3+KBig=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-df1/kPiZFBEq9Um26Qbo9XaYj2J8BOXQmunCQWquDTo=";
|
||||
|
||||
meta = {
|
||||
description = "ACP adapter for Codex CLI";
|
||||
homepage = "https://github.com/agentclientprotocol/codex-acp";
|
||||
license = lib.licenses.asl20;
|
||||
mainProgram = "codex-acp";
|
||||
platforms = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
|
||||
};
|
||||
})
|
||||
Reference in new issue
Block a user