@@ -6,14 +6,6 @@
66(setq package-build-working-dir (expand-file-name ".")
77 package-build-archive-dir (expand-file-name "."))
88
9−(defun melpa2nix-install-package ()
10− (if (not noninteractive)
11− (error "`melpa2nix-install-package' is to be used only with -batch"))
12− (pcase command-line-args-left
13− (`(,archive ,elpa)
14− (progn (setq package-user-dir elpa)
15− (melpa2nix-install-file archive)))))
16−
179(defun melpa2nix-build-package ()
1810 (if (not noninteractive)
1911 (error "`melpa2nix-build-package' is to be used only with -batch"))
@@ -48,20 +40,3 @@
4840 (time-to-seconds (time-since start-time))
4941 (current-time-string))
5042 (princ (format "%s\n" archive-file)))))
51−
52−(defun melpa2nix-install-from-buffer ()
53− "Install a package from the current buffer."
54− (let ((pkg-desc (if (derived-mode-p 'tar-mode)
55− (package-tar-file-info)
56− (package-buffer-info))))
57− ;; Install the package itself.
58− (package-unpack pkg-desc)
59− pkg-desc))
60−
61−(defun melpa2nix-install-file (file)
62− "Install a package from a file.
63−The file can either be a tar file or an Emacs Lisp file."
64− (with-temp-buffer
65− (insert-file-contents-literally file)
66− (when (string-match "\\.tar\\'" file) (tar-mode))
67− (melpa2nix-install-from-buffer)))