a12l
March 25, 2019, 8:14am
1
I"ve the following snippet in ~/.config/nixpkgs/home.nix
:
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
use-package
];
};
And this at the beginning of ~/.emacs.d/init.el
:
(eval-when-compile
(require 'use-package))
But when I start Emacs I get the following error message
Warning (initialization): An error occurred while loading ‘/home/user/.emacs.d/init.el’:
File is missing: Cannot open load file, No such file or directory, use-package
I based this snippet on what I found in John Wiegley’s Emacs dotfiles and the documentation for use-package
.
What should I do to get Emacs recognize packages installed with Home Manager?
ryantm
March 26, 2019, 4:33am
2
I’m not exactly sure what’s wrong, but here are some suggestions:
Make sure the emacs you are running was installed with home-manager
Try (require 'package)(package-initialize)
before requiring use-package.
a12l
March 26, 2019, 3:04pm
3
I’m tempted to just delete this thread…
I forgot to run home-manager switch
. Only built the derivation earlier.
4 Likes
(package-initialize)
isn’t required because home-manager installs stuff in normal Lisp load path, AFAIK. package
installs stuff into ~/.emacs.d/elpa
or somewhere similar, and this directory is not on the default load-path.
2 Likes
@a12l Can you share your Emacs configuration and Nix config? I am trying to use Nix to manage Emacs packages, but fails.