Link doom config mutably
This commit is contained in:
@ -71,22 +71,28 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# We tell HomeManager where the config files belong
|
# We tell HomeManager where the config files belong
|
||||||
home.file.".config/doom" = {
|
# home.file.".config/doom" = {
|
||||||
# With onChange you even could rebuild doom emacs when rebuilding HomeManager but I don't want this to become too slow
|
# # With onChange you even could rebuild doom emacs when rebuilding HomeManager but I don't want this to become too slow
|
||||||
recursive = true; # is a directory
|
# recursive = true; # is a directory
|
||||||
source = ../../config/doom;
|
# source = ../../config/doom;
|
||||||
};
|
# };
|
||||||
|
|
||||||
# If doom is enabled we want to clone the framework
|
# If doom is enabled we want to clone the framework
|
||||||
# The activation script is being run when home-manager rebuilds
|
# The activation script is being run when home-manager rebuilds
|
||||||
home.activation = mkIf cfg.useDoom {
|
home.activation = mkIf cfg.useDoom {
|
||||||
|
|
||||||
# Because we write to the filesystem, this script has to be run after HomeManager's writeBoundary
|
# Because we write to the filesystem, this script has to be run after HomeManager's writeBoundary
|
||||||
installDoomEmacs = hm.dag.entryAfter [ "writeBoundary" ] ''
|
installDoomEmacs = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
if [ ! -d "${config.home.homeDirectory}/.emacs.d" ]; then
|
if [ ! -d "${config.home.homeDirectory}/.emacs.d" ]; then
|
||||||
git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "${config.home.homeDirectory}/.emacs.d"
|
git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "${config.home.homeDirectory}/.emacs.d"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# With this approach we keep the config mutable as it is not copied and linked from store
|
||||||
|
linkDoomConfig = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
if [ ! -L "${config.home.homeDirectory}/.config/doom" ]; then
|
||||||
|
ln -sf ${config.home.homeDirectory}/NixFlake/config/doom ${config.home.homeDirectory}/.config/doom
|
||||||
|
fi
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user