{ config, pkgs, ... }:
let
RELOAD = "export PATH=${pkgs.emacs}/bin:$PATH && export PATH=${pkgs.git}/bin:$PATH && /home/safri/.nix/home/emacs/doom.sh";
in
{
home.packages = with pkgs; [
# DOOM Emacs dependencies
binutils
(ripgrep.override { withPCRE2 = true; })
gnutls
fd
imagemagick
zstd
nodePackages.javascript-typescript-langserver
sqlite
editorconfig-core-c
emacs-all-the-icons-fonts
];
home.file = {
"${config.xdg.configHome}/doom" = {
source = ./doom;
recursive = true;
onChange = ''${RELOAD}'';
};
};
services.emacs = {
enable = true;
client.enable = true;
defaultEditor = true;
};
programs.emacs = {
enable = true;
# https://www.reddit.com/r/NixOS/comments/14sdrw6/help_with_setting_up_with_emacs_build/
package = pkgs.emacs.overrideAttrs (oldAttrs: {
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [ pkgs.pkg-config ];
buildInputs = with pkgs; (oldAttrs.buildInputs or []) ++ [ gtk3 webkitgtk_4_1 ];
configureFlags = oldAttrs.configureFlags ++ [
"--without-x"
"--without-ns"
"--with-pgtk"
"--with-xwidgets"
"--with-png"
"--with-jpeg"
"--with-sound"
"--with-file-notifications=yes"
];
});
};
}
error:
error: 1 dependencies of derivation '/nix/store/b5sd6yjylb4rnvp5j5nzxkmlirkafhy1-emacs-with-packages-30.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/53lsmkgw4c9jydr38qidf8qlq9ic9bm5-emacs.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wvazwsx4x8i8iyxqkipnklh849ql3g34-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ijhlfsbcb979msf1dhjfjy3wm1sxy92z-home-manager-generation.drv' failed to build
┏━ 1 Errors:
┃ error: builder for '/nix/store/absyd2xhcm6n76hkbi2c9v4n5q028lbx-emacs-30.1.drv' failed with exit code 1;
┃ last 25 log lines:
┃ > closing open displays. This is no problem if you just use
┃ > one display, but if you use more than one and close one of them
┃ > Emacs may crash.
┃ > See https://gitlab.gnome.org/GNOME/gtk/issues/221
┃ > checking for malloc_trim... yes
┃ > checking for dbus-1 >= 1.0... yes
┃ > checking for dbus_watch_get_unix_fd... yes
┃ > checking for dbus_type_is_valid... yes
┃ > checking for dbus_validate_bus_name... yes
┃ > checking for dbus_validate_path... yes
┃ > checking for dbus_validate_interface... yes
┃ > checking for dbus_validate_member... yes
┃ > checking for gio-2.0 >= 2.26... yes
┃ > checking whether GSettings is in gio... yes
┃ > checking for gobject-2.0 >= 2.0... yes
┃ > checking for lgetfilecon in -lselinux... yes
┃ > checking for gnutls >= 2.12.2... yes
┃ > checking for libsystemd >= 222... yes
┃ > checking for tree-sitter >= 0.20.2... yes
┃ > checking for sys/inotify.h... yes
┃ > checking for inotify_init... yes
┃ > checking for inotify_init1... yes
┃ > checking for webkit2gtk-4.1 >= 2.12 webkit2gtk-4.1 < 2.41.92... no
┃ > checking for webkit2gtk-4.0 >= 2.12 webkit2gtk-4.0 < 2.41.92... no
┃ > configure: error: xwidgets requested but WebKitGTK+ or WebKit framework not found.
┃ For full logs, run:
┃ nix log /nix/store/absyd2xhcm6n76hkbi2c9v4n5q028lbx-emacs-30.1.drv
I believe the issue is that emacs isn’t detecting webkit during the build process but I have no idea how to fix that.
Any help would be appreciated.