How to reference the home-manager emacs package (programs.emacs.finalPackage)

Hi all,

how do I reference the emacs package that is generated/created by using home-manager’s programs.emacs.* settings?

I would need to reference it as the source of a home.file."XXX".source for compatibility reasons.

Using the vim package as an example:

home.file."some/link/somewhere".source = "${pkgs.vim}/bin/vim";

What do I need to put instead of the ${pkgs.vim}? Using pkgs.emacs-nox or similar gives me the “plain” package, not the one that has the home-manager-configured stuff…

I tried various incantations of config.programs.emacs.finalPackage or similar, but always get an error…

Kind Regards,
Johannes

P.S.: Happy new year, everyone!

That should work aiui, what errors are you getting?

And I can answer myself:

home.file."some/link/somewhere".source = "${config.programs.emacs.finalPackage}/bin/emacs";

No idea why it works now, I guess there was a typo somewhere in my first tries… :frowning:

Kind Regards,
Johannes

1 Like