emacs: changes to make onChange script better

This commit is contained in:
Alexandre Cavalheiro 2024-08-01 10:57:05 -03:00
parent c693a00cd4
commit 2f43749a32
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF

View file

@ -1,9 +1,12 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ let
programs.emacs.enable = true; packagesNeeded = with pkgs; [
# CORE
git
emacs
ripgrep
home.packages = with pkgs; [
# Optional for DOOM # Optional for DOOM
clang clang
coreutils coreutils
@ -16,37 +19,32 @@
pt_BR pt_BR
] ]
)) # for flyspell )) # for flyspell
gnuplot # for plotting graphs gnuplot_qt # for plotting graphs
languagetool # for grammar languagetool # for grammar
ledger # for accounting and org-ledger ledger # for accounting and org-ledger
gzip # Otherwise random errors occur from the onChange script
]; ];
in
{
home.packages = packagesNeeded;
# Neatly place the configuration files for doom in their right place. # Neatly place the configuration files for doom in their right place.
xdg.configFile."doom" = xdg.configFile."doom" = {
let source = ./doom;
# What DOOM needs to be able to install/sync. recursive = true;
packagesNeeded = with pkgs; [
git
emacs
ripgrep
];
in
{
source = ./doom;
recursive = true;
onChange = # sh onChange = # sh
'' ''
# Need to set this so DOOM can find all binaries. # Need to set this so DOOM can find all binaries.
export PATH="${lib.strings.concatMapStrings (x: x + "/bin:") packagesNeeded}$PATH" export PATH="${lib.strings.concatMapStrings (x: x + "/bin:") packagesNeeded}$PATH"
if [ ! -d "$HOME/.emacs.d" ]; then if [ ! -d "$HOME/.emacs.d" ]; then
git clone https://github.com/hlissner/doom-emacs $HOME/.emacs.d git clone https://github.com/hlissner/doom-emacs $HOME/.emacs.d
$HOME/.emacs.d/bin/doom install $HOME/.emacs.d/bin/doom install
else else
# Needed to apply the configuration changes. # Needed to apply the configuration changes.
$HOME/.emacs.d/bin/doom sync $HOME/.emacs.d/bin/doom sync
fi fi
''; '';
}; };
} }