Things
All checks were successful
/ test (push) Successful in 14s

This commit is contained in:
Andrea Ciceri 2024-08-21 12:47:16 +02:00
parent 0afba6526f
commit 0043273db6
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
4 changed files with 37 additions and 124 deletions

110
flake.lock generated
View file

@ -7,11 +7,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1723799695, "lastModified": 1724231640,
"narHash": "sha256-8W/xxCpwQC9LOnwUO0Q7aGAF463ozaxcwQ6/toqtz0M=", "narHash": "sha256-1FnV0jk8GAItH71zVTzrhULylMKyXsb4FNmtn9b46Ug=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "3b4f8179de2b4950540d70161854e43fe1010eae", "rev": "758aa1deb09d8d2dce7bd3a016434e8fcedfab89",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,38 +20,6 @@
"type": "github" "type": "github"
} }
}, },
"extra-package-agenix-el": {
"flake": false,
"locked": {
"lastModified": 1722968702,
"narHash": "sha256-npdFsig2UmLcyTg6gaoPfpBfFjaTJ5vhbhx2zeDJ6B8=",
"owner": "t4ccer",
"repo": "agenix.el",
"rev": "1ef747135401ed4b905acc2b3ec3f909d9cb62e1",
"type": "github"
},
"original": {
"owner": "t4ccer",
"repo": "agenix.el",
"type": "github"
}
},
"extra-package-combobulate": {
"flake": false,
"locked": {
"lastModified": 1710175386,
"narHash": "sha256-rww0/6304xZWTFRo1BVcfSDdXOXtlgmfZOxAoOIjYsk=",
"owner": "mickeynp",
"repo": "combobulate",
"rev": "ee82c568ad639605518f62f82fae4bcc0dfdbb81",
"type": "github"
},
"original": {
"owner": "mickeynp",
"repo": "combobulate",
"type": "github"
}
},
"extra-package-copilot": { "extra-package-copilot": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -68,30 +36,14 @@
"type": "github" "type": "github"
} }
}, },
"extra-package-gptel": {
"flake": false,
"locked": {
"lastModified": 1723651088,
"narHash": "sha256-5uu9v8vqadAhFldMnMSyE5FUF5QNN5LlU++hLq34Mvg=",
"owner": "karthink",
"repo": "gptel",
"rev": "17f39f6a8144496252eacc012ef7f1d6a2ac883a",
"type": "github"
},
"original": {
"owner": "karthink",
"repo": "gptel",
"type": "github"
}
},
"extra-package-indent-bars": { "extra-package-indent-bars": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1723492886, "lastModified": 1724025552,
"narHash": "sha256-U/rzvl2EKT/ia0hvoy0c9muPvJ/5UXhsrO4yiOaaJQI=", "narHash": "sha256-xBwtj991wy2O764ATBEILsGk597f7pkCmDfbF+tbjns=",
"owner": "jdtsmith", "owner": "jdtsmith",
"repo": "indent-bars", "repo": "indent-bars",
"rev": "209817a622e2fbf9201a6c756928c9f320431449", "rev": "b72fa098d7c48d61fb4b508071bd77d054268f4e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -100,39 +52,6 @@
"type": "github" "type": "github"
} }
}, },
"extra-package-meow-tree-sitter": {
"flake": false,
"locked": {
"lastModified": 1719843724,
"narHash": "sha256-XdTeUq1J/zKoYaIDbl86LYuhJZJbaLFEpz7i5CxE8js=",
"owner": "skissue",
"repo": "meow-tree-sitter",
"rev": "d8dce964fac631a6d44b650a733075e14854159c",
"type": "github"
},
"original": {
"owner": "skissue",
"repo": "meow-tree-sitter",
"type": "github"
}
},
"extra-package-nix-ts-mode": {
"flake": false,
"locked": {
"lastModified": 1705596103,
"narHash": "sha256-jEUmhfLE7cFan4/PF4qBiEOLsjM3Q4iSDTlM+0CYwZg=",
"owner": "antifuchs",
"repo": "nix-ts-mode",
"rev": "0ef4e663add03d026a1804f57ac7d5453a635b15",
"type": "github"
},
"original": {
"owner": "antifuchs",
"ref": "improve-indented-string-indentation",
"repo": "nix-ts-mode",
"type": "github"
}
},
"extra-package-notmuch-notify": { "extra-package-notmuch-notify": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -226,11 +145,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723637854, "lastModified": 1723991338,
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", "rev": "8a3354191c0d7144db9756a74755672387b702ba",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -254,11 +173,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1723688146, "lastModified": 1724098845,
"narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=", "narHash": "sha256-D5HwjQw/02fuXbR4LCTo64koglP2j99hkDR79/3yLOE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3d4ac725177c030b1e289015989da2ad9d56af0", "rev": "f1bad50880bae73ff2d82fafc22010b4fc097a9c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,13 +206,8 @@
"root": { "root": {
"inputs": { "inputs": {
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"extra-package-agenix-el": "extra-package-agenix-el",
"extra-package-combobulate": "extra-package-combobulate",
"extra-package-copilot": "extra-package-copilot", "extra-package-copilot": "extra-package-copilot",
"extra-package-gptel": "extra-package-gptel",
"extra-package-indent-bars": "extra-package-indent-bars", "extra-package-indent-bars": "extra-package-indent-bars",
"extra-package-meow-tree-sitter": "extra-package-meow-tree-sitter",
"extra-package-nix-ts-mode": "extra-package-nix-ts-mode",
"extra-package-notmuch-notify": "extra-package-notmuch-notify", "extra-package-notmuch-notify": "extra-package-notmuch-notify",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",

View file

@ -10,33 +10,12 @@
url = "github:jdtsmith/indent-bars"; url = "github:jdtsmith/indent-bars";
flake = false; flake = false;
}; };
extra-package-nix-ts-mode = {
url = "github:antifuchs/nix-ts-mode/improve-indented-string-indentation";
flake = false;
};
extra-package-combobulate = {
url = "github:mickeynp/combobulate";
flake = false;
};
extra-package-agenix-el = {
url = "github:t4ccer/agenix.el";
flake = false;
};
extra-package-copilot = {
url = "github:zerolfx/copilot.el";
flake = false;
};
extra-package-notmuch-notify = { extra-package-notmuch-notify = {
url = "github:firmart/notmuch-notify"; url = "github:firmart/notmuch-notify";
flake = false; flake = false;
}; };
extra-package-meow-tree-sitter = { extra-package-copilot = {
url = "github:skissue/meow-tree-sitter"; url = "github:zerolfx/copilot.el";
flake = false;
};
# TODO remove when there will be a new release including GPT-4o
extra-package-gptel = {
url = "github:karthink/gptel";
flake = false; flake = false;
}; };
}; };

18
init.el
View file

@ -784,7 +784,13 @@ This is meant to be an helper to be called from the window manager."
(use-package gptel (use-package gptel
:custom :custom
(gptel-api-key (getenv "OPENAI_API_KEY")) (gptel-api-key (getenv "OPENAI_API_KEY"))
(gptel-model "gpt-4o")
:config :config
(require 'gptel-curl)
(add-hook 'gptel-post-response-functions 'gptel-end-of-response)
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
(defun ccr/suggest-eshell-command () (defun ccr/suggest-eshell-command ()
(interactive) (interactive)
(save-excursion (save-excursion
@ -803,6 +809,18 @@ This is meant to be an helper to be called from the window manager."
(message "ChatGPT response failed with: %s" (plist-get info :status)) (message "ChatGPT response failed with: %s" (plist-get info :status))
(kill-region start-pos end-pos) (kill-region start-pos end-pos)
(insert response))))))) (insert response)))))))
(add-to-list 'display-buffer-alist
'("^\\*ChatGPT\\*"
(display-buffer-full-frame)
(name . "floating")))
(defun ccr/start-chatgpt () ;; Used from outside Emacs by emacsclient --eval
(display-buffer (gptel "*ChatGPT*"))
(set-frame-name "floating")
;; (delete-other-windows)
;; (add-hook 'kill-buffer-hook 'delete-frame nil 't)
) ;; destroy frame on exit
) )
(use-package copilot (use-package copilot

View file

@ -4,10 +4,8 @@ pkgs: epkgs: let
depsPerPackage = { depsPerPackage = {
indent-bars = [elpaPackages.compat]; indent-bars = [elpaPackages.compat];
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch]; notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
gptel = [pkgs.emacsPackages.transient elpaPackages.compat]; copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
meow-tree-sitter = [melpaPackages.meow];
}; };
overrideAttrsPerPackage = { overrideAttrsPerPackage = {
@ -40,6 +38,7 @@ pkgs: epkgs: let
(package: ! builtins.elem package.pname (builtins.attrNames extraPackages)) (package: ! builtins.elem package.pname (builtins.attrNames extraPackages))
(with epkgs.melpaPackages; [ (with epkgs.melpaPackages; [
meow meow
meow-tree-sitter
dracula-theme dracula-theme
nord-theme nord-theme
catppuccin-theme catppuccin-theme
@ -75,6 +74,7 @@ pkgs: epkgs: let
cape cape
which-key which-key
nix-mode nix-mode
nix-ts-mode
agenix agenix
unisonlang-mode unisonlang-mode
purescript-mode purescript-mode
@ -101,6 +101,8 @@ pkgs: epkgs: let
consult-notmuch consult-notmuch
poly-org poly-org
casual-calc casual-calc
gptel
agenix
# org-re-reveal # FIXME very not nice hash mismatch when building # org-re-reveal # FIXME very not nice hash mismatch when building
# gptel # TODO uncomment when there will be a new release including GPT-4o # gptel # TODO uncomment when there will be a new release including GPT-4o
]) ++ (with elpaPackages; [ ]) ++ (with elpaPackages; [