Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extraConfig (in homeManager.emacs) is ignored when using this overlay with a conig.el from path #367

Open
thomaslaich opened this issue Nov 14, 2023 · 0 comments

Comments

@thomaslaich
Copy link

When providing extraConfig in the emacs program using home manager, the value is ignored when using this overlay.

That is, if I do something like this

  programs.emacs = {
    enable = true;
    extraConfig = ''
      (load-theme 'kanagawa t)
    '';
    extraPackages = epkgs: [ epkgs.autothemer epkgs.kanagawa-theme ];
    package = (pkgs.emacsWithPackagesFromUsePackage {
      config = ./config.el; #contains my actual emacs config
      package = pkgs.emacs-pgtk;
      ...
    });
    ...
  };

then (load-theme 'kanagawa t) is not called when starting emacs.

If I do the same with vanilla emacs, then the theme gets applied. That is, if I do this, then the theme gets applied:

  programs.emacs = {
    enable = true;
    extraConfig = ''
      (load-theme 'kanagawa t)
    '';
    extraPackages = epkgs: [ epkgs.autothemer epkgs.kanagawa-theme ];
    package = pkgs.emacs;
    ...
  };

You might ask why I want to provide both extraConfig and a config.el. The reason is that I want to provide system wide themes using a separate module (see https://github.com/buntec/nix-colorscheme). This way I can switch my theme in one place and it updates tmux, kitty, neovim, emacs, fish, etc. For that I have to provide some extra configuration to emacs to load the theme.

Is this a bug or intended behaviour? It would be perfect for my use case if default.el would contain the merged output from extraConfig and my config.el :)

strangely enough, the packages from emacs.extraPackages and extraEmacsPackages from this overlay seem to get merged.

My full emacs config here: https://github.com/thomaslaich/nix-config/blob/main/home/emacs/emacs.nix

(I'm very new to nix, so forgive if this is a dumb question/request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant