Compare commits

...

9 commits

Author SHA1 Message Date
35cdeff2cc flake.lock: Update
All checks were successful
/ test (push) Successful in 7m16s
Flake lock file updates:

• Updated input 'emacs-overlay':
    'github:nix-community/emacs-overlay/2a294b099b479a62a5e37964dfe5ceb75e74fdd8' (2024-05-01)
  → 'github:nix-community/emacs-overlay/ce14ca664285a33988892c485f12d20fcb792d49' (2024-05-01)
• Updated input 'extra-package-copilot':
    'github:zerolfx/copilot.el/edf517a57f539eb41eaa2f92c6752538f3a62b72' (2024-04-15)
  → 'github:zerolfx/copilot.el/733bff26450255e092c10873580e9abfed8a81b8' (2024-05-01)
2024-05-01 16:26:11 +00:00
113f4faa4f
Disable org-re-reveal
All checks were successful
/ test (push) Successful in 19s
2024-05-01 10:44:46 +02:00
a59a8b82e5
Add casual 2024-05-01 10:44:37 +02:00
d20d454939
Remove copilot overrides 2024-05-01 10:44:19 +02:00
d69eca9772
Remove chatgpt 2024-05-01 10:43:20 +02:00
b8d1c727a1
Use gptel
All checks were successful
/ test (push) Successful in 23s
2024-05-01 09:49:02 +02:00
74e0f203bb
Use nixd instead of nil 2024-05-01 09:48:51 +02:00
a8622fd7d5
Follow mouse 2024-05-01 09:48:40 +02:00
e187e15b85
Remove chatgpt 2024-05-01 09:48:28 +02:00
4 changed files with 60 additions and 71 deletions

77
flake.lock generated
View file

@ -7,11 +7,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1710320774,
"narHash": "sha256-TrLaYznIzUGy4vIRw4hDDlOKuF/vDD1J49cLtkxvgAI=",
"lastModified": 1714580308,
"narHash": "sha256-D9sx3irluJ7qjmKSORgwFIT7+woMBaUdik1g3AzvWK0=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "c68aeff603f1b5c4cc7a57b876cf5e7101f2f21c",
"rev": "ce14ca664285a33988892c485f12d20fcb792d49",
"type": "github"
},
"original": {
@ -36,22 +36,6 @@
"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": {
"flake": false,
"locked": {
@ -71,11 +55,11 @@
"extra-package-copilot": {
"flake": false,
"locked": {
"lastModified": 1710320315,
"narHash": "sha256-YY/6vODg2MSPMi+61Ii5aQiDQS5B6YPMP1VP1dDNOLs=",
"lastModified": 1714572852,
"narHash": "sha256-Knp36PtgA73gtYO+W1clQfr570bKCxTFsGW3/iH86A0=",
"owner": "zerolfx",
"repo": "copilot.el",
"rev": "57d5e670786ca8156772c6dcb38e6ff67c5efd62",
"rev": "733bff26450255e092c10873580e9abfed8a81b8",
"type": "github"
},
"original": {
@ -87,11 +71,11 @@
"extra-package-indent-bars": {
"flake": false,
"locked": {
"lastModified": 1713279232,
"narHash": "sha256-usa8xpg2dvXwFcQf8gKSZ+kOy6EGJ+e2mkvGAjEX66o=",
"lastModified": 1713707934,
"narHash": "sha256-KGqP80JC0/uPol6diU8XcuHfK7i0hlKY6NoqAZh4QFY=",
"owner": "jdtsmith",
"repo": "indent-bars",
"rev": "88261051823961f0fc60c3c76b0cf2bae4ab32e4",
"rev": "4974f6c16c7fcc8bbe53fbcd93c74794877287a1",
"type": "github"
},
"original": {
@ -138,11 +122,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
@ -159,11 +143,11 @@
]
},
"locked": {
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
@ -195,11 +179,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1710309369,
"narHash": "sha256-pQo1vDEEyULfvTQeqZixryrDVpGICzGBtj4uIfP4cs0=",
"lastModified": 1713898448,
"narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "9cc7ed20043adf381f1b8354c54ba667b527d538",
"rev": "c0302ec12d569532a6b6bd218f698bc402e93adc",
"type": "github"
},
"original": {
@ -210,11 +194,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1710272261,
"narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=",
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"type": "github"
},
"original": {
@ -227,11 +211,11 @@
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1709237383,
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github"
},
"original": {
@ -244,11 +228,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710162809,
"narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=",
"lastModified": 1714409183,
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ddcd7598b2184008c97e6c9c6a21c5f37590b8d2",
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
"type": "github"
},
"original": {
@ -260,11 +244,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1709961763,
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
"lastModified": 1713714899,
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"type": "github"
},
"original": {
@ -278,7 +262,6 @@
"inputs": {
"emacs-overlay": "emacs-overlay",
"extra-package-agenix-el": "extra-package-agenix-el",
"extra-package-chatgpt": "extra-package-chatgpt",
"extra-package-combobulate": "extra-package-combobulate",
"extra-package-copilot": "extra-package-copilot",
"extra-package-indent-bars": "extra-package-indent-bars",

View file

@ -22,10 +22,6 @@
url = "github:t4ccer/agenix.el";
flake = false;
};
extra-package-chatgpt = {
url = "github:joshcho/ChatGPT.el";
flake = false;
};
extra-package-copilot = {
url = "github:zerolfx/copilot.el";
flake = false;

36
init.el
View file

@ -48,7 +48,8 @@
(backup-directory-alist `(("." . ,temporary-file-directory)))
(auto-save-files-name-transforms `((".*" ,temporary-file-directory t)))
(backup-by-copying t)
(focus-follows-mouse 't)
(focus-follows-mouse t)
(mouse-autoselect-window t)
:config
(set-face-background 'vertical-border (face-background 'default))
(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))
@ -464,7 +465,7 @@
(nix-ts-mode . (lambda ()
(require 'eglot)
(add-to-list 'eglot-server-programs
'(nix-ts-mode . ("nil")))
'(nix-ts-mode . ("nixd")))
;; FIXME `nixd' completion not working, will give it a second try in the future
;; '(nix-ts-mode . ("nixd" :initializationOptions (:eval (:depth 10 :workers 4)
;; :formatting (:command "alejandra")
@ -793,14 +794,29 @@ 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 r" . consult-org-roam-search))
(use-package chatgpt
(use-package gptel
:custom
(gptel-api-key (getenv "OPENAI_API_KEY"))
:config
(dolist (e '(("spiega" . "Spiega il seguente")
("documenta" . "Documenta il seguente usando la sintassi appropriata in modo che possa essere inserito nel codice")
))
(push e chatgpt-code-query-map))
:bind
("C-c i" . chatgpt-query))
(defun ccr/suggest-eshell-command ()
(interactive)
(save-excursion
(eshell-bol)
(let ((start-pos (point))
(end-pos (line-end-position)))
(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
:custom
@ -811,7 +827,7 @@ This is meant to be an helper to be called from the window manager."
(use-package pass
:config
(require 'password-store-otp) ;; FIXME use `use-pacakges' idiomatic way
(require 'password-store-otp) ;; FIXME use `use-pacakge' idiomatic way
:bind (("C-c p p" . password-store-copy)
("C-c p o" . password-store-otp-token-copy)

View file

@ -4,18 +4,11 @@ pkgs: epkgs: let
depsPerPackage = {
indent-bars = [elpaPackages.compat];
chatgpt = [melpaPackages.polymode];
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
};
overrideAttrsPerPackage = {
copilot = old: {
postInstall = ''
cp -r "$src/dist" "$LISPDIR"
'';
};
};
overrideAttrsPerPackage = { };
# *Attrset* containig extra emacs packages from flake inputs
extraPackages = lib.mapAttrs (inputName: input: let
@ -96,8 +89,9 @@ pkgs: epkgs: let
notmuch
consult-notmuch
poly-org
# casual
org-re-reveal
casual
# org-re-reveal # FIXME very not nice hash mismatch when building
gptel
]) ++ (with elpaPackages; [
delight
kind-icon