Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nix/neomacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,18 @@ in stdenv.mkDerivation {

# Wrap the binary with required environment variables
postInstall = if isLinux then ''
install -Dm644 ${./site-start.el} \
"$out/share/emacs/site-lisp/site-start.el"

wrapProgram $out/bin/emacs \
--set WPE_BACKEND_LIBRARY "${libwpe-fdo}/lib/libWPEBackend-fdo-1.0.so" \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules" \
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1" \
--prefix PATH : "${wpewebkit}/libexec/wpe-webkit-2.0"
'' else ''
install -Dm644 ${./site-start.el} \
"$out/share/emacs/site-lisp/site-start.el"

Comment on lines +278 to +280
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This install -Dm644 ${./site-start.el} ... block duplicates the one in the Linux branch above. To reduce duplication and make future edits less error-prone, install the stub once outside the platform conditional and keep only platform-specific wrapping inside each branch.

Copilot uses AI. Check for mistakes.
wrapProgram $out/bin/emacs \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules"
'';
Comment on lines 268 to 283
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install -Dm644 ${./site-start.el} ... snippet is duplicated in both branches of the if isLinux conditional. Consider moving the install step outside the conditional (or factoring it into a shared string) so the Linux/Darwin branches only differ in the wrapProgram flags.

Suggested change
postInstall = if isLinux then ''
install -Dm644 ${./site-start.el} \
"$out/share/emacs/site-lisp/site-start.el"
wrapProgram $out/bin/emacs \
--set WPE_BACKEND_LIBRARY "${libwpe-fdo}/lib/libWPEBackend-fdo-1.0.so" \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules" \
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1" \
--prefix PATH : "${wpewebkit}/libexec/wpe-webkit-2.0"
'' else ''
install -Dm644 ${./site-start.el} \
"$out/share/emacs/site-lisp/site-start.el"
wrapProgram $out/bin/emacs \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules"
'';
postInstall = ''
install -Dm644 ${./site-start.el} \
"$out/share/emacs/site-lisp/site-start.el"
'' + (if isLinux then ''
wrapProgram $out/bin/emacs \
--set WPE_BACKEND_LIBRARY "${libwpe-fdo}/lib/libWPEBackend-fdo-1.0.so" \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules" \
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1" \
--prefix PATH : "${wpewebkit}/libexec/wpe-webkit-2.0"
'' else ''
wrapProgram $out/bin/emacs \
--set GIO_MODULE_DIR "${glib-networking}/lib/gio/modules"
'');

Copilot uses AI. Check for mistakes.
Expand Down
9 changes: 9 additions & 0 deletions nix/site-start.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
;;; site-start.el --- Nix package startup stub -*- lexical-binding: t; -*-

;; Home Manager and other Nix-based Emacs integrations may expect the
;; package site startup file to exist, even when the package does not need
;; site-wide initialization of its own.

(provide 'site-start)

;;; site-start.el ends here
Loading