diff --git a/.gitignore b/.gitignore index d78f810..47d6bdf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ !README.org !init.el !straight-boot.el -!install_deps +!runtime_pkgs # track versions of installed packages !straight diff --git a/etc/conf.org b/etc/conf.org index 835fa2c..cd65393 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -221,7 +221,7 @@ dependencies to return." (let ((helpers (list "yay"))) (-first #'executable-find helpers))) -(defun nd/pacman-dependencies (uninstalled?) +(defun nd/pacman-dependencies (&optional uninstalled?) "Return pacman and aur dependencies. If UNINSTALLED? is non-nil, return only the packages that are not installed but required by this config." @@ -287,6 +287,10 @@ installed but required by this config." (try-install "unofficial" nd/aur-helper aur-args aur)) (message "No aur helper found"))) nil)) + +(defun nd/dump-arch-dependencies () + (-let (((pacman aur) (nd/pacman-dependencies nil))) + (print (s-join "\n" (append pacman aur))))) #+end_src *** Setup #+begin_src emacs-lisp diff --git a/install_deps b/install_deps deleted file mode 100755 index d8ccf78..0000000 --- a/install_deps +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -## Install all dependencies for emacs to run at full capacity - -EMACS_PKG=emacs-nativecomp - -if ! command -v emacs > /dev/null; then - if sudo pacman -S "$EMACS_PKG"; then - echo "Could not install emacs. Exiting" - exit 1 - fi -fi - -if command -v yay > /dev/null; then - emacs -batch -l init.el -f nd/install-arch-dependencies -else - echo "Yay not installed. Exiting" - exit 1 -fi diff --git a/runtime_pkgs b/runtime_pkgs new file mode 100755 index 0000000..2beb857 --- /dev/null +++ b/runtime_pkgs @@ -0,0 +1,11 @@ +#!/bin/bash + +# Print a list of all pacman packages required to run this emacs configuration + +this_dir=$(dirname "$0") + +emacs -batch \ + -l "$this_dir/init.el" \ + -f nd/dump-arch-dependencies \ + 2> /dev/null | \ + sed 's/"//'