nix-community / nix-doom-emacs

doom-emacs packaged for Nix [maintainers=@thiagokokada]
MIT License
218 stars 43 forks source link

all-the-icons font is not installed #362

Closed koiuo closed 1 year ago

koiuo commented 1 year ago

I installed the emacs-doom as flake using home-manager

{
  inputs = {
    ...
    nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
  };

  outputs = { home-manager, nixpkgs, nix-doom-emacs, ... }@inputs: {
    nixosConfigurations = {
      ...
    };
    homeConfigurations =
      let
        ...
      in {
        koiuo = home-manager.lib.homeManagerConfiguration {
          pkgs = nixpkgs.legacyPackages."x86_64-linux";
          modules = [
            nix-doom-emacs.hmModule
            ./users/koiuo/home.nix
            ...
          ];
        };
      };
  };
}

I used test/doom.d as my private config.

Upon startup emacs won't display any icons.

Doing M-x all-the-icons-install-fonts fixes the issue.

Seems like this package should be installed by the module.

ckiee commented 1 year ago

It installs it for the whole user. NixOS provides fonts.fonts and a emacs-all-the-icons-fonts.

It'd be neat if fontconfig had a environment variable for extra font paths and all-the-icons.el knew about it but otherwise this is not feasible from our environment. (excluding the optional HM module)

Maybe upstream is willing?

koiuo commented 1 year ago

@ckiee , I'd highly appreciate an explanation why icons were broken after the installation then, and what would be the correct way to fix the issue on NixOS.

It's my first time installing emacs, and it doesn't help, that I do this on NixOS (here the procedure is quite different from other OSes).

Thanks in advance

ckiee commented 1 year ago

@koiuo Let's both try nix run github:nix-community/nix-doom-emacs and see if it's consistent.

On my system (with a ~3week old nixos-unstable) I have:

ckie@cookiemonster ~ -> fc-list | rg 'all-the-' | head -n1
/nix/store/0r2jnr8nn2gzag3ga7ww737h7iw5wf6z-emacs-all-the-icons-fonts-5.0.0/share/fonts/all-the-icons/weathericons.ttf: Weather Icons:style=Regular
ckie@cookiemonster ~ -> fc-list | rg 'all-the-' | rg home
ckie@cookiemonster ~ ->

Same in Doom: (describe-font)

name (opened by): -unknown-all-the-icons-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1
       full name: all-the-icons:pixelsize=16:foundry=unknown:weight=normal:slant=normal:width=normal:scalable=true
       file name: /nix/store/0r2jnr8nn2gzag3ga7ww737h7iw5wf6z-emacs-all-the-icons-fonts-5.0.0/share/fonts/all-the-icons/all-the-icons.ttf

See the relevant section of my NixOS config.

In the nix run doom, same:

name (opened by): -unknown-all-the-icons-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1
       full name: all-the-icons:pixelsize=16:foundry=unknown:weight=normal:slant=normal:width=normal:scalable=true
       file name: /nix/store/0r2jnr8nn2gzag3ga7ww737h7iw5wf6z-emacs-all-the-icons-fonts-5.0.0/share/fonts/all-the-icons/all-the-icons.ttf
koiuo commented 1 year ago

Ok, I think I see now what was the issue: I had my emacs daemon running, perhaps (?) since the time I tried vanilla emacs (I suppose the doom-emacs hmModule won't kill an already running daemon).

Anyway, I removed the fonts installed by the emacs, update the font cache, restarted the deamon, and now all the outputs on all the steps look similar to yours, and icons are displayed almost fine (they aren't loaded at once, only after some interaction with emacs. But that doesn't seem to be a concern of this module).

Thanks for your time!

ckiee commented 1 year ago

Welcome to NixOS! ❤️