NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.77k stars 13.88k forks source link

Weird fontforge dependency in NixOS headless image #8301

Closed copumpkin closed 8 years ago

copumpkin commented 9 years ago

I'm building a NixOS EC2 headless image. When rebuilding from the latest master, I noticed I was building fontforge, which seemed odd. Turns out dejavu-fonts depends on fontforge, and config.fontconfig.enable defaults to true, and when true it pulls in a default list of fonts.fonts, which includes dejavu-fonts.

Not sure which part of that chain is the wrong one, but I'm inclined to say that fontconfig.enable shouldn't default to true unless you have some sort of graphical system.

cc @ttuegel since you seem to have a decent amount of experience in that space.

copumpkin commented 9 years ago

Also, it looks like fontforge is 23M and dejavu is 19M, so unless I'm mistaken, that adds about 42M to my disk image.

vcunat commented 9 years ago

IMHO anything font-related will be useless on a typical headless server-like config. I'd take the default from what's in services.xserver.enable – that's possible and sensible, isn't it?

@copumpkin: you're mistaken, as dejavu_fonts retains no references at all, so you shouldn't get fontforge in the image. But there would be fontconfig, I think.

edolstra commented 9 years ago

On a headless image, you will probably want to include nixpkgs/nixos/modules/profiles/minimal.nix in your config, or set environment.noXlibs = true.

Not enabling the X server does not disable fonts (because you may still want to run X11 apps via ssh).

vcunat commented 9 years ago

I suspect this is quite a frequent setup; do we have it documented somewhere? EDIT: maybe just a few lines like your comment and a simple example configuration.nix, I don't know...

ttuegel commented 9 years ago

Is there a reason we build DejaVu from source anyway? The project provides pre-built TTFs for download.

vcunat commented 9 years ago

In general, building from source is preferred in nixpkgs. We have binary cache for getting binaries. In case of data-like stuff as fonts, however, I'm not certain at all.

copumpkin commented 9 years ago

I'm not opposed to it building from source, as it seems to reduce the space of how things can vary. I'm just opposed to needing to do that for a headless image. I'll load minimal.nix into my EC2 image, but it doesn't feel like a very discoverable/sustainable way of doing things.

Profpatsch commented 8 years ago

(triage) still a problem?

grahamc commented 8 years ago

Closing, because I think the original problem is solved with the minimal profile.