I’m working on a module for installing emacs + doom emacs. I am trying to use home.activation
to clone the doom emacs repository into $XDG_CONFIG_HOME/emacs
then just do the doom install manually, but I’m having trouble in the activation script accessing packages from home.packages
.
I’ve figured out I can do the following to get it to find the path to git:
home.activation.install-doom = hm.dag.entryAfter [ "writeBoundary" ] ''
if ! [ -d "${config.xdg.configHome}/emacs" ]; then
$DRY_RUN_CMD ${
getExe pkgs.git
} clone $VERBOSE_ARG --depth=1 --single-branch "https://github.com/doomemacs/doomemacs.git" "${config.xdg.configHome}/emacs"
fi
'';
However, I have the following in my git config:
[url "ssh://git@github.com/"]
insteadOf = "https://github.com/"
Which causes the activation to fail because it then cannot find ssh:
Activating install-doom
Cloning into '/home/fortruce/.config/emacs'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
Is it possible to run home.activation
scripts such that they have access to all the packages of the config? Maybe there is a simple way to setup the PATH in the script itself to fix this that I’m missing.
EDIT: Tried adding to path temporarily in the script which gets me there as long as I have an active ssh-agent around with my key. Looks really hacky though, but maybe this is the solution?
PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" $DRY_RUN_CMD git clone $VERBOSE_ARG --depth=1 --single-branch "https://github.com/doomemacs/doomemacs.git" "${config.xdg.configHome}/emacs"