I am managing my doom config dir with home manager. It lives in ~/.config/doom
. It gets deleted every time I reboot my system.
{
pkgs,
lib,
config,
xdg,
...
}:
{
options = {
my.emacs.enable =
lib.mkEnableOption "enables emacs";
};
config = lib.mkIf config.my.direnv.enable {
programs.emacs.enable = true;
...
xdg.configFile."doom" = {
enable = true;
source = ./doom-emacs;
recursive = true;
};
};
}
I have also tried sourcing the directory as a package in src
in mkDerivation
and indirectly as part of a the install phase in a fetchurl
. They all work. However when I reboot the directory disappears.
I have another config for Neovim where I move a dir into the .config
dir. This does not get deleted on boot.
{
pkgs,
config,
fetchFromGitHub,
...
}:
{
# https://www.reddit.com/r/NixOS/comments/13uc87h/masonnvim_broke_on_nixos/
programs.neovim.enable = true;
home.sessionVariables = {
EDITOR = "nvim";
};
xdg.configFile."nvim".source = pkgs.stdenv.mkDerivation {
name = "NvChad";
src = pkgs.fetchFromGitHub {
owner = "NvChad";
repo = "NvChad";
rev = "f17e83010f25784b58dea175c6480b3a8225a3e9";
hash = "sha256-P5TRjg603/7kOVNFC8nXfyciNRLsIeFvKsoRCIwFP3I=";
};
installPhase = ''
mkdir -p $out
cp -r ./* $out/
cd $out/
cp -r ${./my_nvchad_config} $out/lua/custom
'';
};
}
I am using a flake.
My config is in my NixOS config on github.