Improve the "try!" macro by embedding use-package

This commit is contained in:
Sameer Rahmani 2024-04-28 19:18:05 +01:00
parent b6abd6fce9
commit 87c5b868db
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
1 changed files with 7 additions and 2 deletions

View File

@ -98,7 +98,12 @@ same NAME is set to t."
(defmacro try! (pkg &rest details)
"Try the PKG with the given DETAILS in the running session."
"Try the PKG with the given DETAILS in the running session.
It will install the package using Nix and make it available to the current
running session. For a persistant installation use `use!'."
(declare (indent defun))
(let ((flake-dir (format "%s/share/fg42" (fg42-path)))
(cwd (getenv "PWD")))
(cd flake-dir)
@ -107,7 +112,7 @@ same NAME is set to t."
(out (car (string-split output "\n" t))))
(add-emacs-vars out)
(cd cwd)
out)))
`(use-package ,pkg ,@details))))
(provide 'fpkg)