fix: doom-emacs

This commit is contained in:
Ryan Yin
2023-12-30 13:45:02 +08:00
parent dd2edb3216
commit e1981c2e91
3 changed files with 30 additions and 9 deletions

17
flake.lock generated
View File

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

View File

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

View File

@@ -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: <https://www.gnu.org/software/emacs/tour/index.html>
# 2. Doom Emacs: <https://github.com/doomemacs/doomemacs/blob/master/docs/index.org>
#
{
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/
'';
};
};