From e1981c2e91f802a10c693396d7f5bc3a583bb1d1 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 30 Dec 2023 13:45:02 +0800 Subject: [PATCH] fix: doom-emacs --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ home/base/desktop/emacs/default.nix | 17 ++++++++--------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 9e474351..a18d37ea 100644 --- a/flake.lock +++ b/flake.lock @@ -116,6 +116,22 @@ "type": "github" } }, + "doomemacs": { + "flake": false, + "locked": { + "lastModified": 1702066305, + "narHash": "sha256-PdQD6f+TGgu0Nf/zvmJOHzrfLC50d4pWjK2dIQIizlw=", + "owner": "doomemacs", + "repo": "doomemacs", + "rev": "03d692f129633e3bf0bd100d91b3ebf3f77db6d1", + "type": "github" + }, + "original": { + "owner": "doomemacs", + "repo": "doomemacs", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", @@ -965,6 +981,7 @@ "agenix": "agenix", "anyrun": "anyrun", "astronvim": "astronvim", + "doomemacs": "doomemacs", "emacs-overlay": "emacs-overlay", "home-manager": "home-manager_2", "hyprland": "hyprland", diff --git a/flake.nix b/flake.nix index 40f1fd1e..4861df93 100644 --- a/flake.nix +++ b/flake.nix @@ -164,6 +164,11 @@ url = "github:AstroNvim/AstroNvim/v3.40.3"; flake = false; }; + # doom-emacs is a configuration framework for GNU Emacs. + doomemacs = { + url = "github:doomemacs/doomemacs"; + flake = false; + }; polybar-themes = { url = "github:adi1090x/polybar-themes"; diff --git a/home/base/desktop/emacs/default.nix b/home/base/desktop/emacs/default.nix index 8dca61fb..812061b4 100644 --- a/home/base/desktop/emacs/default.nix +++ b/home/base/desktop/emacs/default.nix @@ -1,10 +1,16 @@ # ============================================== -# based on doomemacs's auther's config: +# Based on doomemacs's auther's config: # https://github.com/hlissner/dotfiles/blob/master/modules/editors/emacs.nix +# +# Emacs Tutorials: +# 1. Official: +# 2. Doom Emacs: +# { config, lib, pkgs, + doomemacs, ... }: with lib; let @@ -17,10 +23,6 @@ in { enable = mkEnableOption "Emacs Editor"; doom = { enable = mkEnableOption "Doom Emacs"; - repoUrl = mkOption { - type = types.str; - default = "https://github.com/doomemacs/doomemacs"; - }; }; }; @@ -63,10 +65,7 @@ in { home.activation = mkIf cfg.doom.enable { installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] '' - if [ ! -d "${config.xdg.configHome}/emacs" ]; then - echo "Installing Doom Emacs..." - ${pkgs.git}/bin/git clone --depth=1 --single-branch "${cfg.doom.repoUrl}" "${config.xdg.configHome}/emacs" - fi + ${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/ ''; }; };