From 7be05bcdd667ac0ddf09c86ee0fb00d6309d3e11 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 23 Sep 2023 10:04:46 +0200 Subject: [PATCH] feat: download doom emacs on activation --- modules/editors/emacs/home.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/editors/emacs/home.nix b/modules/editors/emacs/home.nix index 308e44a..1998194 100644 --- a/modules/editors/emacs/home.nix +++ b/modules/editors/emacs/home.nix @@ -13,7 +13,9 @@ { config, user, unstable, pkgs, inputs, location, ... }: -{ +let + doomRev = "844a82c"; +in { services.emacs = { enable = true; client = { @@ -32,6 +34,24 @@ ]; }; + home.activation = { + linkDoomConfig = { + after = [ "writeBoundary" "createXdgUserDirectories" ]; + before = [ ]; + data = + '' + EMACS=$HOME/.emacs.d + if [ ! -d "$EMACS" ]; then + ${pkgs.git}/bin/git clone https://github.com/doomemacs/doomemacs $EMACS + (cd $EMACS && ${pkgs.git}/bin/git checkout ${doomRev}) + fi + if [ ! -d "$HOME/.doom.d" ]; then + ln -s ${location}/modules/editors/emacs/doom.d $HOME/.doom.d + fi + ''; + }; + }; + home.packages = with pkgs; [ emacs-all-the-icons-fonts #binutils # for native comp -- 2.48.1