mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Added doom emacs readme
This commit is contained in:
parent
facffb804e
commit
e54b7e92e2
23
user/app/doom-emacs/README.org
Normal file
23
user/app/doom-emacs/README.org
Normal file
|
@ -0,0 +1,23 @@
|
|||
#+title: Doom Emacs
|
||||
|
||||
* What is Doom Emacs?
|
||||
[[https://github.com/doomemacs/doomemacs][Doom Emacs]] is a distribution of the [[https://www.gnu.org/software/emacs/][Emacs Text Editor]] designed for [[https://www.vim.org/][Vim]] users. I like to use Emacs due to its extensibility and extra features it is capable of (besides text editing). Some of these extra features include:
|
||||
- [[https://orgmode.org/][Org Mode]] (Hierarchical text-based document format)
|
||||
- [[https://www.orgroam.com/][Org Roam]] (A second brain / personal wiki)
|
||||
- [[https://orgmode.org/][Org Agenda]] (Calendar and todo list)
|
||||
- [[https://magit.vc/][magit]] (Git Client)
|
||||
|
||||
[[doom.png]]
|
||||
|
||||
I have found Emacs to be incredibly efficient, and transferring my workflow to fit inside of Emacs has allowed me to get much more work done. I primarily use Emacs for writing, note-taking, task/project management and organizing information.
|
||||
|
||||
* My Config
|
||||
This directory includes my Doom Emacs configuration, which consists of:
|
||||
- [[./config.el][config.el]] - Main configuration
|
||||
- [[./init.el][init.el]] - Doom modules (easy sets of packages curated by Doom)
|
||||
- [[./packages.el][packages.el]] - Additional packages from Melpa (Emacs package manager).
|
||||
- [[./doom.nix][doom.nix]] - Loads Nix Doom Emacs and my configuration into my flake when imported
|
||||
- [[./themes/doom-stylix-theme.el.mustache][doom-stylix-theme.el.mustache]] - Mustache Doom Emacs template to be used with stylix, requires my [[../../style/stylix.nix][stylix.nix module]] as well
|
||||
- A few other [[./scripts][random scripts]]
|
||||
|
||||
My full config is a [[./doom.org][literate org document (doom.org)]].
|
|
@ -21,6 +21,7 @@
|
|||
- [[#eaf][EAF]]
|
||||
- [[#my-initel][My init.el]]
|
||||
- [[#my-packagesel][My packages.el]]
|
||||
- [[#nix-integration][Nix Integration]]
|
||||
#+END_QUOTE
|
||||
|
||||
* What is Doom Emacs?
|
||||
|
@ -30,7 +31,7 @@
|
|||
- [[https://orgmode.org/][Org Agenda]] (Calendar and todo list)
|
||||
- [[https://magit.vc/][magit]] (Git Client)
|
||||
|
||||
I have found Emacs to be incredibly efficient, and transferring my workflow to fit inside of Emacs has allowed me to get much more work done.
|
||||
I have found Emacs to be incredibly efficient, and transferring my workflow to fit inside of Emacs has allowed me to get much more work done. I primarily use Emacs for writing, note-taking, task/project management and organizing information.
|
||||
|
||||
* Configuration for Doom Emacs
|
||||
Doom Emacs is configured via 3 main files, written in Elisp, a dialect of the Lisp programming langauge designed for Emacs. These 3 main files are:
|
||||
|
@ -48,7 +49,9 @@ You can also load separate files inside of [[./config.el][config.el]] via the =l
|
|||
|
||||
I use this functionality to load my private config file with non-public information.
|
||||
|
||||
* My [[./config.el][config.el]]
|
||||
Doom Emacs is traditionally installed by cloning the repository ([[https://github.com/doomemacs/doomemacs][https://github.com/doomemacs/doomemacs]]) and running =./bin/doom install=. I instead install Doom Emacs via Nix Doom Emacs ([[https://github.com/nix-community/nix-doom-emacs][https://github.com/nix-community/nix-doom-emacs]]), which packages Doom Emacs as a Nix derivation. The advantage to this is that I get more reproducibility and the ability to rollback updates (if anything breaks), but the downside is that every time the config is changed/updated, the entire derivation must be rebuilt from scratch (this is often time-consuming). I load this as a Nix derivation in my flake using the [[./doom.nix][doom.nix]] module.
|
||||
|
||||
* My config.el
|
||||
** Preamble + User Configuration
|
||||
#+BEGIN_SRC emacs-lisp :tangle config.el
|
||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
@ -1374,7 +1377,7 @@ I don't have this active right now since I'm exploring tab-bar mode instead!
|
|||
"o w" #'eaf-open-browser-with-history)
|
||||
|
||||
#+END_SRC
|
||||
* My [[./init.el][init.el]]
|
||||
* My init.el
|
||||
This section is the [[./init.el][init.el]] section, which controls which Doom modules are loaded.
|
||||
|
||||
=SPC h d h= (vim) or =C-h d h= (non-vim) can be used to access Doom's documentation (including a "Module Index").
|
||||
|
@ -1562,7 +1565,7 @@ This section is the [[./init.el][init.el]] section, which controls which Doom mo
|
|||
|
||||
#+END_SRC
|
||||
|
||||
* My [[./packages.el][packages.el]]
|
||||
* My packages.el
|
||||
The [[./packages.el][packages.el]] file allows extra packages to be configured outside of the typical Doom modules from [[./init.el][init.el]].
|
||||
|
||||
Packages are declared via =(package! some-package)= where =some-package= is from MELPA, ELPA, or emacsmirror.
|
||||
|
@ -1601,3 +1604,55 @@ Any git package can be configured for a particular commit or branch:
|
|||
(package! focus)
|
||||
(package! olivetti)
|
||||
#+END_SRC
|
||||
* Nix Integration
|
||||
In order to have Nix load my Doom Emacs configuration [[./doom.nix][doom.nix]], which I source in the =imports= block of my [[../../home.nix][home.nix]].
|
||||
#+BEGIN_SRC nix :tangle doom.nix
|
||||
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, myThemePolarity, ... }:
|
||||
let
|
||||
myDashboardLogo = ./. + "/nix-" + myThemePolarity + ".png";
|
||||
in
|
||||
{
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./.;
|
||||
};
|
||||
home.file.".emacs.d/themes/doom-stylix-theme.el".source = config.lib.stylix.colors {
|
||||
template = builtins.readFile ./themes/doom-stylix-theme.el.mustache;
|
||||
extension = ".el";
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
git
|
||||
nodejs
|
||||
wmctrl
|
||||
jshon
|
||||
aria
|
||||
hledger
|
||||
nodePackages.mermaid-cli
|
||||
(python3.withPackages (p: with p; [
|
||||
pandas
|
||||
requests
|
||||
pyqt6 sip qtpy qt6.qtwebengine epc lxml pyqt6-webengine
|
||||
pysocks
|
||||
pymupdf
|
||||
markdown
|
||||
]))];
|
||||
home.file.".emacs.d/eaf" = {
|
||||
source = "${eaf}";
|
||||
recursive = true;
|
||||
};
|
||||
home.file.".emacs.d/eaf/app/browser" = {
|
||||
source = "${eaf-browser}";
|
||||
recursive = true;
|
||||
onChange = "
|
||||
pushd ~/.emacs.d/eaf/app/browser;
|
||||
rm package*.json;
|
||||
npm install darkreader @mozilla/readability && rm package*.json;
|
||||
popd;
|
||||
";
|
||||
};
|
||||
home.file.".emacs.d/org-nursery" = {
|
||||
source = "${org-nursery}";
|
||||
};
|
||||
home.file.".emacs.d/dashboard-logo.png".source = myDashboardLogo;
|
||||
}
|
||||
#+END_SRC
|
||||
|
|
Loading…
Reference in a new issue