users/foo-dogsquared/programs/doom-emacs: refactor

This commit is contained in:
Gabriel Arazas 2024-03-27 16:33:52 +08:00
parent fe0c088ce9
commit 92e409e40f
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -7,6 +7,8 @@
let let
userCfg = config.users.foo-dogsquared; userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.doom-emacs; cfg = userCfg.programs.doom-emacs;
doomEmacsInstallation = "${config.xdg.configHome}/emacs";
in in
{ {
options.users.foo-dogsquared.programs.doom-emacs.enable = options.users.foo-dogsquared.programs.doom-emacs.enable =
@ -28,17 +30,17 @@ in
}; };
# Automatically install Doom Emacs from here. # Automatically install Doom Emacs from here.
home.mutableFile."${config.xdg.configHome}/emacs" = { home.mutableFile.${doomEmacsInstallation} = {
url = "https://github.com/doomemacs/doomemacs.git"; url = "https://github.com/doomemacs/doomemacs.git";
type = "git"; type = "git";
extraArgs = [ "--depth" "1" ]; extraArgs = [ "--depth" "1" ];
postScript = '' postScript = ''
${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force ${doomEmacsInstallation}/bin/doom install --no-config --no-fonts --install --force
${config.xdg.configHome}/emacs/bin/doom sync ${doomEmacsInstallation}/bin/doom sync
''; '';
}; };
home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ]; home.sessionPath = [ "${doomEmacsInstallation}/bin" ];
# Doom Emacs dependencies for the usual modules. # Doom Emacs dependencies for the usual modules.
home.packages = with pkgs; [ home.packages = with pkgs; [