summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Santiago <[email protected]>2024-10-29 00:09:24 -0300
committerLeonardo Santiago <[email protected]>2024-10-29 00:09:24 -0300
commit8de0064b16a1cc27deedee06c05e6343a197e175 (patch)
tree60a5cb3d570733cf0ab474e05b99a63f89f1a63b
parent4842e81317e9815540d559d689be51d13191e1e4 (diff)
revert emacs-overlay to last where ox-hugo worked.
-rw-r--r--flake.lock26
-rw-r--r--modules/emacs/README.org62
-rw-r--r--modules/emacs/default.nix36
-rw-r--r--modules/emacs/org.nix20
4 files changed, 73 insertions, 71 deletions
diff --git a/flake.lock b/flake.lock
index f59ca8f..3cb9cad 100644
--- a/flake.lock
+++ b/flake.lock
@@ -72,11 +72,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
- "lastModified": 1725267572,
- "narHash": "sha256-s5+GUIs8OewO1McYn3bhMz31Q+Xl0WRxUTKp+lPZLno=",
+ "lastModified": 1716916086,
+ "narHash": "sha256-n/uf+jsjrXDUuDE6npM2hFfmPRfoYmEcpcoUuPstwi8=",
"owner": "nix-community",
"repo": "emacs-overlay",
- "rev": "2f7c7275d542f59760bd307e5805572cee65ae37",
+ "rev": "b6c62d8135f943ea1e2733aa644cbd146afe2d62",
"type": "github"
},
"original": {
@@ -106,11 +106,11 @@
"systems": "systems_2"
},
"locked": {
- "lastModified": 1710146030,
- "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "lastModified": 1726560853,
+ "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@@ -159,11 +159,11 @@
"nixpkgs_old": "nixpkgs_old"
},
"locked": {
- "lastModified": 1730050814,
- "narHash": "sha256-3BmY+KKfLeZJFqt8hyvzrX/N/kaQy5zrHOtwNWCKdRY=",
+ "lastModified": 1730162224,
+ "narHash": "sha256-V238jWFRp2XSzRYdcrmHJ6Z0Ut29agcOCr193H/+tB8=",
"ref": "refs/heads/master",
- "rev": "7c33b28f7b0cf926bc28f17daeee1ab7c92152f2",
- "revCount": 67225,
+ "rev": "4229b5aaf305291ffb4966d33645255cdbeca9da",
+ "revCount": 67286,
"type": "git",
"url": "ssh://[email protected]/mixrank/mixrank"
},
@@ -205,11 +205,11 @@
},
"nixpkgs-stable": {
"locked": {
- "lastModified": 1725001927,
- "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
+ "lastModified": 1729973466,
+ "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
+ "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
diff --git a/modules/emacs/README.org b/modules/emacs/README.org
index 3ed48b3..4ccec53 100644
--- a/modules/emacs/README.org
+++ b/modules/emacs/README.org
@@ -33,7 +33,8 @@ You can also use it as a ~nixosModule~, in order to add additional packages like
** Theme and font
#+begin_src emacs-lisp :tangle yes
-(use-package modus-themes)
+(use-package modus-themes
+ :ensure t)
;; (use-package kanagawa-theme)
(load-theme 'wheatgrass t)
@@ -57,8 +58,10 @@ You can also use it as a ~nixosModule~, in order to add additional packages like
* Utility
** Searching
#+begin_src emacs-lisp :tangle yes
-(use-package rg)
+(use-package rg
+ :ensure t)
(use-package ctrlf
+ :ensure t
:config (ctrlf-mode +1))
#+end_src
** Age encryption
@@ -81,10 +84,12 @@ Configuration to automagically open age files, and to encrypt them correctly to
** Nerd icons
#+begin_src emacs-lisp :tangle yes
(use-package nerd-icons
+ :ensure t
:custom
(nerd-icons-font-family "Iosevka Nerd Font"))
(use-package nerd-icons-completion
+ :ensure t
:after nerd-icons
:after marginalia
:hook (marginalia-mode . nerd-icons-completion-marginal)
@@ -92,6 +97,7 @@ Configuration to automagically open age files, and to encrypt them correctly to
(nerd-icons-completion-mode))
(use-package nerd-icons-dired
+ :ensure t
:hook (dired-mode . nerd-icons-dired-mode)
:custom (dired-listing-switches "-alh"))
@@ -100,6 +106,7 @@ Configuration to automagically open age files, and to encrypt them correctly to
To integrate with nix shells.
#+begin_src emacs-lisp :tangle yes
(use-package envrc
+ :ensure t
:config (envrc-global-mode))
#+end_src
** Magit
@@ -107,8 +114,10 @@ Configurations for magit
*** Use Magit
#+begin_src emacs-lisp :tangle yes
(use-package magit
+ :ensure t
:custom (magit-process-finish-apply-ansi-colors t))
(use-package magit-delta
+ :ensure t
:hook (magit-mode . magit-delta-mode))
#+end_src
@@ -119,6 +128,7 @@ Configurations for magit
To interact with gitlab and github.
#+begin_src emacs-lisp :tangle yes
(use-package forge
+ :ensure t
:after magit)
#+end_src
@@ -126,15 +136,18 @@ To interact with gitlab and github.
Pretty minibuffer support
#+begin_src emacs-lisp :tangle yes
(use-package vertico
+ :ensure t
:config (vertico-mode))
(use-package orderless
+ :ensure t
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles basic partial-completion)))))
(use-package marginalia
+ :ensure t
:config (marginalia-mode))
#+end_src
** Projects
@@ -167,6 +180,7 @@ Pretty minibuffer support
Better help defaults
#+begin_src emacs-lisp :tangle yes
(use-package helpful
+ :ensure t
:config
(global-set-key (kbd "C-h f") #'helpful-callable)
(global-set-key (kbd "C-h v") #'helpful-variable)
@@ -174,11 +188,13 @@ Better help defaults
(global-set-key (kbd "C-h k") #'helpful-key))
(use-package which-key
+ :ensure t
:config (which-key-mode))
#+end_src
** Bind key
#+begin_src emacs-lisp :tangle yes
-(use-package bind-key)
+(use-package bind-key
+ :ensure t)
#+end_src
** Eglot
Language server support. Already comes installed but used to configure additional language servers.
@@ -189,6 +205,7 @@ Language server support. Already comes installed but used to configure additiona
(use-package eglot-booster
:after eglot
+ :ensure t
:config (eglot-booster-mode))
#+end_src
@@ -196,6 +213,7 @@ Language server support. Already comes installed but used to configure additiona
Completion popup system
#+begin_src emacs-lisp :tangle yes
(use-package corfu
+ :ensure t
:config (global-corfu-mode)
:custom
(corfu-auto t)
@@ -205,7 +223,8 @@ Completion popup system
#+end_src
** Vterm
#+begin_src emacs-lisp :tangle yes
-(use-package eat)
+(use-package eat
+ :ensure t)
#+end_src
** Compilation
Add support for ansi escape codes in compilation
@@ -218,6 +237,7 @@ Add support for ansi escape codes in compilation
** Pdf reader
#+begin_src emacs-lisp :tangle yes
(use-package pdf-tools
+ :ensure t
:defer t
:mode ("\\.pdf\\'" . pdf-view-mode)
:magic ("%PDF" . pdf-view-mode))
@@ -226,6 +246,7 @@ Add support for ansi escape codes in compilation
Minor mode to allow opening files in chunks
#+begin_src emacs-lisp :tangle yes
(use-package vlf
+ :ensure t
:config
(require 'vlf-setup)
(custom-set-variables
@@ -245,6 +266,7 @@ It also relies on python lsp server with builtin ruff support.
** Nix
#+begin_src emacs-lisp :tangle yes
(use-package nix-mode
+ :ensure t
:hook (nix-mode . eglot-ensure))
#+end_src
** Rust
@@ -259,21 +281,25 @@ Try to use the package.
** Markdown
#+begin_src emacs-lisp :tangle yes
(use-package markdown-mode
+ :ensure t
:mode "\\.md\\'")
#+end_src
** Coq
#+begin_src emacs-lisp :tangle yes
(use-package proof-general
+ :ensure t
:custom
(proof-splash-enable nil))
(use-package company-coq
+ :ensure t
:hook (coq-mode . company-coq-mode))
#+end_src
* Personal
** Org mode
#+begin_src emacs-lisp :tangle yes
(use-package org
+ :ensure 'nil
:hook (org-mode . org-indent-mode)
:bind ("C-c a" . org-agenda)
:config
@@ -339,34 +365,9 @@ Try to use the package.
In order to publish files to hugo from org.
#+begin_src emacs-lisp :tangle yes
(use-package ox-hugo
+ :ensure t
:after ox)
#+end_src
-** Calendar
-try out emacs calfw
-#+begin_src emacs-lisp :tangle yes
-(use-package calfw)
-(use-package calfw-org
- :bind ("C-c c l" . cfw:open-org-calendar)
- :custom (cfw:org-overwrite-default-keybinding t))
-#+end_src
-** Email
-*** RSS feed reader
-#+begin_src emacs-lisp :tangle yes
-(use-package elfeed
- :custom
- (elfeed-feeds
- '(("https://xeiaso.net/blog.rss" nixos)
- ("https://smallcultfollowing.com/babysteps//atom.xml" rust)
- ("https://fasterthanli.me/index.xml" rust nixos)
- ("http://radar.spacebar.org/f/a/weblog/rss/1" tom7)
- ("https://matklad.github.io/feed.xml" rust zig)
- ("https://blog.m-ou.se/index.xml" rust)
- ("https://without.boats/index.xml" rust)
- )))
-
-#+end_src
-
-#+RESULTS:
*** Mu4e
**** Setting up mu4e.
@@ -388,6 +389,7 @@ Helper functions, to try to discover which mail pertains to which account.
Actual mu4e definition
#+begin_src emacs-lisp :tangle yes
(use-package mu4e
+ :ensure t
:bind ("C-c m" . mu4e)
:config
:custom
diff --git a/modules/emacs/default.nix b/modules/emacs/default.nix
index bbf1ba2..37b8951 100644
--- a/modules/emacs/default.nix
+++ b/modules/emacs/default.nix
@@ -1,19 +1,20 @@
{ pkgs, inputs, lib, config, ...}:
let
outside-emacs = with pkgs; [
+ git
nil
ripgrep
emacs-lsp-booster
delta
];
- org-tangle-elisp-blocks = (pkgs.callPackage ./org.nix {inherit pkgs; inherit (inputs) from-elisp;}).org-tangle ({ language, flags } : let
- is-elisp = (language == "emacs-lisp") || (language == "elisp");
- is-tangle = if flags ? ":tangle" then
- flags.":tangle" == "yes" || flags.":tangle" == "y" else false;
- in
- is-elisp && is-tangle
- );
- config-el = pkgs.writeText "config.el" (org-tangle-elisp-blocks (builtins.readFile ./README.org));
+ # org-tangle-elisp-blocks = (pkgs.callPackage ./org.nix { inherit (inputs) from-elisp; }).org-tangle ({ language, flags } : let
+ # is-elisp = (language == "emacs-lisp") || (language == "elisp");
+ # is-tangle = if flags ? ":tangle" then
+ # flags.":tangle" == "yes" || flags.":tangle" == "y" else false;
+ # in
+ # is-elisp && is-tangle
+ # );
+ # config-el = pkgs.writeText "config.el" (org-tangle-elisp-blocks (builtins.readFile ./README.org));
emacs = pkgs.emacsWithPackagesFromUsePackage {
package = pkgs.emacs.override {
withGTK3 = true;
@@ -23,21 +24,20 @@ let
withToolkitScrollBars = true;
withImageMagick = true;
};
- override = epkgs: epkgs // {
- eglot-booster = pkgs.callPackage ./eglot-booster.nix {
- inherit (pkgs) fetchFromGitHub;
- inherit (epkgs) trivialBuild;
- };
+ override = epkgs: let
+ callPackage = pkgs.lib.callPackageWith (pkgs // epkgs);
+ in epkgs // {
+ eglot-booster = callPackage ./eglot-booster.nix {};
};
- config = config-el;
- alwaysEnsure = true;
+ config = ./README.org;
+ alwaysTangle = true;
defaultInitFile = true;
- extraEmacsPackages = epkgs: with epkgs; [
- (treesit-grammars.with-grammars (g: with g; [
+ extraEmacsPackages = epkgs: [
+ (epkgs.treesit-grammars.with-grammars (g: with g; [
tree-sitter-rust
tree-sitter-python
]))
- ] ++ outside-emacs;
+ ];
};
in with lib; {
options.santi-modules.emacs.enable = mkEnableOption "Enable emacs configuration";
diff --git a/modules/emacs/org.nix b/modules/emacs/org.nix
index e5fd15c..f795ddd 100644
--- a/modules/emacs/org.nix
+++ b/modules/emacs/org.nix
@@ -1,11 +1,11 @@
-{ pkgs, from-elisp }: {
- org-tangle = block-predicate: text:
- let blocks = (pkgs.callPackage from-elisp { inherit pkgs; }).parseOrgModeBabel text;
- block-to-str = (block:
- if block-predicate { inherit (block) language flags; } then
- block.body
- else
- ""
- );
- in builtins.concatStringsSep "\n" (map block-to-str blocks);
+{ callPackage, from-elisp }: {
+ org-tangle = block-predicate: text: let
+ blocks = (callPackage from-elisp { }).parseOrgModeBabel text;
+ block-to-str = block:
+ if block-predicate { inherit (block) language flags; } then
+ block.body
+ else
+ "";
+ in
+ builtins.concatStringsSep "\n" (map block-to-str blocks);
}