diff --git a/modules/home-manager/profiles/editors.nix b/modules/home-manager/profiles/editors.nix index 57344c3d..09dcab55 100644 --- a/modules/home-manager/profiles/editors.nix +++ b/modules/home-manager/profiles/editors.nix @@ -11,7 +11,6 @@ let cfg = config.profiles.editors; in { options.profiles.editors = { neovim.enable = lib.mkEnableOption "foo-dogsquared's Neovim setup with Nix"; - emacs.enable = lib.mkEnableOption "foo-dogsquared's (Doom) Emacs setup"; vscode.enable = lib.mkEnableOption "foo-dogsquared's Visual Studio Code setup"; }; @@ -35,82 +34,6 @@ in { }; }) - # I only use Emacs for org-roam (seriously... I only learned Emacs for - # that). Take note this profile doesn't setup Emacs-as-a-development-tool - # thing, rather Emacs-as-a-note-taking tool thing with the complete - # package. - (lib.mkIf cfg.emacs.enable { - programs.emacs = { - enable = true; - package = pkgs.emacs-unstable; - extraPackages = epkgs: with epkgs; [ - vterm - pdf-tools - org-pdftools - org-roam - org-roam-ui - org-roam-bibtex - org-noter-pdftools - ]; - }; - - # Automatically install Doom Emacs from here. - home.mutableFile."${config.xdg.configHome}/emacs" = { - url = "https://github.com/doomemacs/doomemacs.git"; - type = "git"; - extraArgs = [ "--depth" "1" ]; - postScript = '' - ${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force - ${config.xdg.configHome}/emacs/bin/doom sync - ''; - }; - - home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ]; - - # Doom Emacs dependencies. - home.packages = with pkgs; [ - # This is installed just to get Geiser to properly work. - guile_3_0 - - # Required dependencies. - ripgrep - gnutls - emacs-all-the-icons-fonts - - # Optional dependencies. - fd - imagemagick - zstd - - # Module dependencies. - ## :checkers spell - aspell - aspellDicts.en - aspellDicts.en-computers - - ## :tools lookup - wordnet - - ## :lang org +roam2 - texlive.combined.scheme-medium - (python3.withPackages (ps: with ps; [ jupyter ])) - sqlite - anystyle-cli - ]; - - # Enable Emacs server for them quicknotes. - services.emacs = { - enable = true; - socketActivation.enable = true; - }; - - xdg.mimeApps.defaultApplications = { - "application/json" = [ "emacs.desktop" ]; - "text/org" = [ "emacs.desktop" ]; - "text/plain" = [ "emacs.desktop" ]; - }; - }) - # The Visual Studio Code setup. Probably the hardest one to fully configure # not because it has extensions available which will make things harder. # This might make me not consider an extension and settings sync extension diff --git a/users/home-manager/foo-dogsquared/default.nix b/users/home-manager/foo-dogsquared/default.nix index 72513882..f3b1106f 100644 --- a/users/home-manager/foo-dogsquared/default.nix +++ b/users/home-manager/foo-dogsquared/default.nix @@ -11,6 +11,7 @@ browsers.brave.enable = true; browsers.firefox.enable = true; browsers.misc.enable = true; + doom-emacs.enable = true; email.enable = true; email.thunderbird.enable = true; git.enable = true; @@ -48,7 +49,6 @@ # My custom modules. profiles = { editors = { - emacs.enable = true; vscode.enable = true; }; }; diff --git a/users/home-manager/foo-dogsquared/modules/default.nix b/users/home-manager/foo-dogsquared/modules/default.nix index 672fb1d6..cc4a0d6b 100644 --- a/users/home-manager/foo-dogsquared/modules/default.nix +++ b/users/home-manager/foo-dogsquared/modules/default.nix @@ -4,6 +4,7 @@ ./dotfiles.nix ./programs/browsers.nix + ./programs/doom-emacs.nix ./programs/email.nix ./programs/git.nix ./programs/keys.nix diff --git a/users/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix b/users/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix new file mode 100644 index 00000000..72af912e --- /dev/null +++ b/users/home-manager/foo-dogsquared/modules/programs/doom-emacs.nix @@ -0,0 +1,86 @@ +# I only use Emacs for org-roam (seriously... I only learned Emacs for +# that). Take note this profile doesn't setup Emacs-as-a-development-tool +# thing, rather Emacs-as-a-note-taking tool thing with the complete +# package. +{ config, lib, pkgs, ... }: + +let + userCfg = config.users.foo-dogsquared; + cfg = userCfg.programs.doom-emacs; +in +{ + options.users.foo-dogsquared.programs.doom-emacs.enable = + lib.mkEnableOption "foo-dogsquared's Doom Emacs configuration"; + + config = lib.mkIf cfg.enable { + programs.emacs = { + enable = true; + package = pkgs.emacs-unstable; + extraPackages = epkgs: with epkgs; [ + vterm + pdf-tools + org-pdftools + org-roam + org-roam-ui + org-roam-bibtex + org-noter-pdftools + ]; + }; + + # Automatically install Doom Emacs from here. + home.mutableFile."${config.xdg.configHome}/emacs" = { + url = "https://github.com/doomemacs/doomemacs.git"; + type = "git"; + extraArgs = [ "--depth" "1" ]; + postScript = '' + ${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force + ${config.xdg.configHome}/emacs/bin/doom sync + ''; + }; + + home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ]; + + # Doom Emacs dependencies. + home.packages = with pkgs; [ + # This is installed just to get Geiser to properly work. + guile_3_0 + + # Required dependencies. + ripgrep + gnutls + emacs-all-the-icons-fonts + + # Optional dependencies. + fd + imagemagick + zstd + + # Module dependencies. + ## :checkers spell + aspell + aspellDicts.en + aspellDicts.en-computers + + ## :tools lookup + wordnet + + ## :lang org +roam2 + texlive.combined.scheme-medium + (python3.withPackages (ps: with ps; [ jupyter ])) + sqlite + anystyle-cli + ]; + + # Enable Emacs server for them quicknotes. + services.emacs = { + enable = true; + socketActivation.enable = true; + }; + + xdg.mimeApps.defaultApplications = { + "application/json" = [ "emacs.desktop" ]; + "text/org" = [ "emacs.desktop" ]; + "text/plain" = [ "emacs.desktop" ]; + }; + }; +}