Skip to content

Commit

Permalink
feat: use emacs29-pgtk on NixOS, and emacs29-macport for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Jan 6, 2024
1 parent 2928097 commit daa883c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
19 changes: 10 additions & 9 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ fmt:
# format the nix files in this repo
nix fmt

test-nvim:
nvim-test:
rm -rf $"($env.HOME)/.config/astronvim/lua/user"
rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/neovim/astronvim_user/ $"($env.HOME)/.config/astronvim/lua/user"

test-nvim-clean:
nvim-clean:
rm -rf $"($env.HOME)/.config/astronvim/lua/user"

# =================================================
Expand All @@ -180,18 +180,19 @@ reload-emacs-cmd := if os() == "macos" {
+ "systemctl --user status emacs.service"
}

test-emacs:
emacs-test:
rm -rf $"($env.HOME)/.config/doom"
rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom"
doom sync
doom clean

emacs-clean:
rm -rf $"($env.HOME)/.config/doom/"

emacs-purge:
doom purge
doom clean
doom sync
{{reload-emacs-cmd}}

reload-emacs:
emacs-reload:
{{reload-emacs-cmd}}

test-emacs-clean:
rm -rf $"($env.HOME)/.config/doom/"

11 changes: 7 additions & 4 deletions home/base/desktop/editors/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ in {
}

(mkIf pkgs.stdenv.isLinux (
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
let
emacsPkg = pkgs.emacs29;
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
# pgtk (pure gtk) build add native support for wayland.
# https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases
emacsPkg = pkgs.emacs29-pgtk;
in {
home.packages = [emacsPkg];
services.emacs = {
Expand All @@ -92,9 +94,10 @@ in {
))

(mkIf pkgs.stdenv.isDarwin (
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
let
emacsPkg = pkgs.emacs29;
# macport adds some native features based on GNU Emacs 29
# https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac
emacsPkg = pkgs.emacs29-macport;
in {
home.packages = [emacsPkg];
launchd.enable = true;
Expand Down

0 comments on commit daa883c

Please sign in to comment.