profiles/editors: move Emacs submodule as foo-dogsquared's module

No other module is using it so we'll move it.
This commit is contained in:
Gabriel Arazas 2023-12-17 18:01:39 +08:00
parent 761a2f094e
commit 5d5389a87f
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 88 additions and 78 deletions

View File

@ -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

View File

@ -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;
};
};

View File

@ -4,6 +4,7 @@
./dotfiles.nix
./programs/browsers.nix
./programs/doom-emacs.nix
./programs/email.nix
./programs/git.nix
./programs/keys.nix

View File

@ -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" ];
};
};
}