Failed to build gtk+3 on a headless Raspberry Pi 4

I’m trying to setup a Raspi 4.
During the installation it complains about not being able to build GTK3 (log bellow).
The thing that confuses me is that I configured it as a headless system.
It seems to related to Vim but why does Vim require GTK?

building the flake in git+file:///home/nixos/.nixos?ref=master&rev=77f1ad0a6771fdfcdb99cb67eed611e50619bf86...
error: builder for '/nix/store/q0g5rkf1xfis0yh0yx9blg90aqy4nm6a-gtk+3-3.24.30.drv' failed with exit code 1;
       last 10 log lines:
       > Run-time dependency xkbcommon found: YES 1.3.1
       > Run-time dependency iso-codes found: YES 4.6.0
       > Run-time dependency tracker-sparql-3.0 found: YES 3.2.1
       > Did not find CMake 'cmake'
       > Found CMake: NO
       > Run-time dependency cairo-xlib found: NO (tried pkgconfig)
       >
       > meson.build:521:97: ERROR: Dependency "cairo-xlib" not found, tried pkgconfig
       >
       > A full log can be found at /build/gtk+-3.24.30/build/meson-logs/meson-log.txt
       For full logs, run 'nix log /nix/store/q0g5rkf1xfis0yh0yx9blg90aqy4nm6a-gtk+3-3.24.30.drv'.
error (ignored): error: cannot unlink '/mnt/tmp.hh1WVLoWV6/nix-build-librsvg-2.52.4.drv-0': Directory not empty
error: 1 dependencies of derivation '/nix/store/qipkp3cmjwc417b52spp2hjpjxba6qf2-hook.drv' failed to build
error (ignored): error: cannot unlink '/mnt/tmp.hh1WVLoWV6/nix-build-gtk+3-3.24.30.drv-0': Directory not empty
error: 1 dependencies of derivation '/nix/store/ivnk6kc3rl3v5kfs6ljflivdjh898vp4-vim_configurable-8.2.4186.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mpq719z27rnany0539prf97mx2ka7v1x-vim-doc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sg87cc83m54fgdrb0v6i2wa4marskmfp-vim.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9v3nj99i7472fvcw0faz51c7n3f1m9fi-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/iycgc2qvd2m9m2ms85pwl04qndk5cvy2-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lnbbhmz29pc8r3wvx1mnd9by3g2mklcy-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jg786wgx72z3v7n5v6dhhdn1nsplzmpn-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ff6kgvx528159abp2g9nhr0rh4wx4qi3-nixos-system-raspi-test-21.11.20220312.0f85665.drv' failed to build
1 Like

That is caused precisely by using a “headless” system – most packages are not tested or supported in that configuration. So when environment.noXlibs removes some libraries necessary to build GTK, anything depending on that will be broken (on top of having to rebuild the world). I would just recommend going with the xlibs unless you really need every megabyte and can afford the rebuild and trying to fix broken stuff.

1 Like

Ah didn’t notice this on my x86 servers.
I’m using basically the same configuration besides some adjustments.

Edit: I can confirm that removing that reenabling that option solved that problem on the Pi.