You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
911 B

(require 'package)
(defun elpa2nix-install-package ()
(if (not noninteractive)
(error "`elpa2nix-install-package' is to be used only with -batch"))
(pcase command-line-args-left
(`(,archive ,elpa)
(progn (setq package-user-dir elpa)
(elpa2nix-install-file archive)))))
(defun elpa2nix-install-from-buffer ()
"Install a package from the current buffer."
(let ((pkg-desc (if (derived-mode-p 'tar-mode)
;; Install the package itself.
(package-unpack pkg-desc)
(defun elpa2nix-install-file (file)
"Install a package from a file.
The file can either be a tar file or an Emacs Lisp file."
(insert-file-contents-literally file)
(when (string-match "\\.tar\\'" file) (tar-mode))