4 ms·
What is the emacs equivalent of package.json? (whenever I git clone my dotfiles on a new machine I usually have to comment out a bunch of stuff in my ~/.emacs
by warp 7y ago
What is the emacs equivalent of package.json?
(whenever I git clone my dotfiles on a new machine I usually have to comment out a bunch of stuff in my ~/.emacs because it's referencing packages which aren't installed, and I forgot where I installed them from, what version, etc...)
- AtticHacker 7y agoI think you're looking for https://github.com/jwiegley/use-package https://github.com/jwiegley/use-package ?
- brlewis 7y agoThat looks awesome! All of a sudden I feel so primitive with https://gitlab.com/brlewis/brlewis-config/blob/master/emacs/startup.el#L22 https://gitlab.com/brlewis/brlewis-config/blob/master/emacs/...
- AtticHacker 7y agoIt's really handy if you don't use spacemacs / doom-emacs. My (old) config used it heavily. It also defined everything inside a single org file which also serves as a README on github: https://github.com/kwrooijen/.emacs.d https://github.com/kwrooijen/.emacs.d However these days I'm using Spacemacs, currently looking at Doom.
- robto 7y agoI use straight.el[0] for a reproducible package list. It basically clones the packages and stores a map of package->commit, so you can freeze your packages and reproduce them on another machine. You could also use the Guix package manager[1] or the Nix package manager[2] to achieve a similar effect. Reproducible software is much more stable! [0]https://github.com/raxod502/straight.el https://github.com/raxod502/straight.el [1]https://guix.gnu.org/#guix-in-other-distros https://guix.gnu.org/#guix-in-other-distros [2]https://nixos.org/nix/ https://nixos.org/nix/
- warp 7y agoAwesome, thanks!
- MetaDark 7y agoBy default, Emacs doesn't have an equivalent. Although, if you want to use a package manager that supports version lock files, I would recommend straight.el.
- somedudetbh 7y agoBeing emacs, there's a bunch of different ways to do this. I use Cask: https://cask.readthedocs.io/en/latest/guide/installation.html https://cask.readthedocs.io/en/latest/guide/installation.htm... Let's consider Homebrew bundle etc outside of scope and assume you have some workflow that works for you to init a new machine with emacs and some other apps, and you're just worried about the zillions of little emacs packages you are testing or using. So, I have a file called at ~/.emacs.d/Cask, that is just a list of packages on which I depend. This is the only way I install packages. Update the file and do "cask install". This also means if you're packages get weird, or you have some sort of transient .elc problem you can just blow away ~/.emacs.d/.cask and do a 'cask install' (basically .cask ~= node_modules)
- nothrabannosir 7y agoAlternatively, if your workstations are all relatively similar, you can sledge hammer it and just commit all of ~/.emacs.d/ into a private repo, including the packages. It saves me the headache of babysitting dependencies (at the cost of probably not being able to move to Linux without some friction? Never tried.) Caveat emptor. Additionally, I recommend judicious use of (when (boundp 'some-thing) (some-thing)), and (fboundp ..), and (if (require 'foobar nil :noerror) (foobar-mode 1)). This avoids the cascade of errors on installation troubles (at the cost of not being alerted if you're missing them).
- tptacek 7y agoMost Emacs people use use-package for this.