Compare commits
1 commit
35cdeff2cc
...
90ad1a97ed
Author | SHA1 | Date | |
---|---|---|---|
90ad1a97ed |
4 changed files with 50 additions and 39 deletions
35
flake.lock
generated
35
flake.lock
generated
|
@ -7,11 +7,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714580308,
|
"lastModified": 1714467992,
|
||||||
"narHash": "sha256-D9sx3irluJ7qjmKSORgwFIT7+woMBaUdik1g3AzvWK0=",
|
"narHash": "sha256-+JT8h7EDcIRmM1qOxSHcKENruIyDOJ502haTFqnQ+74=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "emacs-overlay",
|
"repo": "emacs-overlay",
|
||||||
"rev": "ce14ca664285a33988892c485f12d20fcb792d49",
|
"rev": "bf94159254c238a379f54bd4c3d11a50322e6469",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,6 +36,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"extra-package-chatgpt": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1698792517,
|
||||||
|
"narHash": "sha256-sh/O36RN34osWLaNVNM3mWKE7mJUdom/ZrBoO2U+Yr8=",
|
||||||
|
"owner": "joshcho",
|
||||||
|
"repo": "ChatGPT.el",
|
||||||
|
"rev": "51c658aa40a106a4ee3afe4376f5ed3d6024c8a9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "joshcho",
|
||||||
|
"repo": "ChatGPT.el",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"extra-package-combobulate": {
|
"extra-package-combobulate": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -55,11 +71,11 @@
|
||||||
"extra-package-copilot": {
|
"extra-package-copilot": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714572852,
|
"lastModified": 1713189314,
|
||||||
"narHash": "sha256-Knp36PtgA73gtYO+W1clQfr570bKCxTFsGW3/iH86A0=",
|
"narHash": "sha256-53BGX2llkrM5mDmFSVe+O/Vo4F2gDJTFh/4TqBuQme8=",
|
||||||
"owner": "zerolfx",
|
"owner": "zerolfx",
|
||||||
"repo": "copilot.el",
|
"repo": "copilot.el",
|
||||||
"rev": "733bff26450255e092c10873580e9abfed8a81b8",
|
"rev": "edf517a57f539eb41eaa2f92c6752538f3a62b72",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -228,11 +244,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714409183,
|
"lastModified": 1714272655,
|
||||||
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
|
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
|
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -262,6 +278,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"emacs-overlay": "emacs-overlay",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"extra-package-agenix-el": "extra-package-agenix-el",
|
"extra-package-agenix-el": "extra-package-agenix-el",
|
||||||
|
"extra-package-chatgpt": "extra-package-chatgpt",
|
||||||
"extra-package-combobulate": "extra-package-combobulate",
|
"extra-package-combobulate": "extra-package-combobulate",
|
||||||
"extra-package-copilot": "extra-package-copilot",
|
"extra-package-copilot": "extra-package-copilot",
|
||||||
"extra-package-indent-bars": "extra-package-indent-bars",
|
"extra-package-indent-bars": "extra-package-indent-bars",
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
url = "github:t4ccer/agenix.el";
|
url = "github:t4ccer/agenix.el";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
extra-package-chatgpt = {
|
||||||
|
url = "github:joshcho/ChatGPT.el";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
extra-package-copilot = {
|
extra-package-copilot = {
|
||||||
url = "github:zerolfx/copilot.el";
|
url = "github:zerolfx/copilot.el";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
36
init.el
36
init.el
|
@ -48,8 +48,7 @@
|
||||||
(backup-directory-alist `(("." . ,temporary-file-directory)))
|
(backup-directory-alist `(("." . ,temporary-file-directory)))
|
||||||
(auto-save-files-name-transforms `((".*" ,temporary-file-directory t)))
|
(auto-save-files-name-transforms `((".*" ,temporary-file-directory t)))
|
||||||
(backup-by-copying t)
|
(backup-by-copying t)
|
||||||
(focus-follows-mouse t)
|
(focus-follows-mouse 't)
|
||||||
(mouse-autoselect-window t)
|
|
||||||
:config
|
:config
|
||||||
(set-face-background 'vertical-border (face-background 'default))
|
(set-face-background 'vertical-border (face-background 'default))
|
||||||
(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))
|
(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))
|
||||||
|
@ -465,7 +464,7 @@
|
||||||
(nix-ts-mode . (lambda ()
|
(nix-ts-mode . (lambda ()
|
||||||
(require 'eglot)
|
(require 'eglot)
|
||||||
(add-to-list 'eglot-server-programs
|
(add-to-list 'eglot-server-programs
|
||||||
'(nix-ts-mode . ("nixd")))
|
'(nix-ts-mode . ("nil")))
|
||||||
;; FIXME `nixd' completion not working, will give it a second try in the future
|
;; FIXME `nixd' completion not working, will give it a second try in the future
|
||||||
;; '(nix-ts-mode . ("nixd" :initializationOptions (:eval (:depth 10 :workers 4)
|
;; '(nix-ts-mode . ("nixd" :initializationOptions (:eval (:depth 10 :workers 4)
|
||||||
;; :formatting (:command "alejandra")
|
;; :formatting (:command "alejandra")
|
||||||
|
@ -794,29 +793,14 @@ This is meant to be an helper to be called from the window manager."
|
||||||
("C-c n l" . consult-org-roam-forward-links)
|
("C-c n l" . consult-org-roam-forward-links)
|
||||||
("C-c n r" . consult-org-roam-search))
|
("C-c n r" . consult-org-roam-search))
|
||||||
|
|
||||||
(use-package gptel
|
(use-package chatgpt
|
||||||
:custom
|
|
||||||
(gptel-api-key (getenv "OPENAI_API_KEY"))
|
|
||||||
:config
|
:config
|
||||||
(defun ccr/suggest-eshell-command ()
|
(dolist (e '(("spiega" . "Spiega il seguente")
|
||||||
(interactive)
|
("documenta" . "Documenta il seguente usando la sintassi appropriata in modo che possa essere inserito nel codice")
|
||||||
(save-excursion
|
))
|
||||||
(eshell-bol)
|
(push e chatgpt-code-query-map))
|
||||||
(let ((start-pos (point))
|
:bind
|
||||||
(end-pos (line-end-position)))
|
("C-c i" . chatgpt-query))
|
||||||
(gptel-request
|
|
||||||
(buffer-substring-no-properties start-pos end-pos) ;the prompt
|
|
||||||
:system "You are proficient with emacs shell (eshell), translate the following to something I could directly prompt to the shell. Your responses should only be code, without explanation or formatting."
|
|
||||||
:buffer (current-buffer)
|
|
||||||
:context (cons (set-marker (make-marker) start-pos)
|
|
||||||
(set-marker (make-marker) end-pos))
|
|
||||||
:callback
|
|
||||||
(lambda (response info)
|
|
||||||
(if (not response)
|
|
||||||
(message "ChatGPT response failed with: %s" (plist-get info :status))
|
|
||||||
(kill-region start-pos end-pos)
|
|
||||||
(insert response)))))))
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package copilot
|
(use-package copilot
|
||||||
:custom
|
:custom
|
||||||
|
@ -827,7 +811,7 @@ This is meant to be an helper to be called from the window manager."
|
||||||
|
|
||||||
(use-package pass
|
(use-package pass
|
||||||
:config
|
:config
|
||||||
(require 'password-store-otp) ;; FIXME use `use-pacakge' idiomatic way
|
(require 'password-store-otp) ;; FIXME use `use-pacakges' idiomatic way
|
||||||
|
|
||||||
:bind (("C-c p p" . password-store-copy)
|
:bind (("C-c p p" . password-store-copy)
|
||||||
("C-c p o" . password-store-otp-token-copy)
|
("C-c p o" . password-store-otp-token-copy)
|
||||||
|
|
|
@ -4,11 +4,18 @@ pkgs: epkgs: let
|
||||||
|
|
||||||
depsPerPackage = {
|
depsPerPackage = {
|
||||||
indent-bars = [elpaPackages.compat];
|
indent-bars = [elpaPackages.compat];
|
||||||
|
chatgpt = [melpaPackages.polymode];
|
||||||
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
|
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
|
||||||
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
|
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
|
||||||
};
|
};
|
||||||
|
|
||||||
overrideAttrsPerPackage = { };
|
overrideAttrsPerPackage = {
|
||||||
|
copilot = old: {
|
||||||
|
postInstall = ''
|
||||||
|
cp -r "$src/dist" "$LISPDIR"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# *Attrset* containig extra emacs packages from flake inputs
|
# *Attrset* containig extra emacs packages from flake inputs
|
||||||
extraPackages = lib.mapAttrs (inputName: input: let
|
extraPackages = lib.mapAttrs (inputName: input: let
|
||||||
|
@ -89,9 +96,8 @@ pkgs: epkgs: let
|
||||||
notmuch
|
notmuch
|
||||||
consult-notmuch
|
consult-notmuch
|
||||||
poly-org
|
poly-org
|
||||||
casual
|
# casual
|
||||||
# org-re-reveal # FIXME very not nice hash mismatch when building
|
org-re-reveal
|
||||||
gptel
|
|
||||||
]) ++ (with elpaPackages; [
|
]) ++ (with elpaPackages; [
|
||||||
delight
|
delight
|
||||||
kind-icon
|
kind-icon
|
||||||
|
|
Reference in a new issue