split home-manager into their own submodules

This commit is contained in:
Danilo Reyes
2026-03-16 15:49:43 -06:00
parent 14eed4f7f6
commit 28c8db6cb7
43 changed files with 1011 additions and 626 deletions

View File

@@ -0,0 +1,61 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [ "emacs" ];
};
cfg = config.my.emacs;
emacs = import ./common.nix {
inherit lib pkgs;
stylixEnabled = if osConfig == null then false else osConfig.my.stylix.enable;
emacsExtraConfig = config.programs.emacs.extraConfig;
emacsExtraPackages = config.programs.emacs.extraPackages;
};
in
{
imports = [ inputs.doom-emacs.homeModule ];
options.my.emacs.enable = lib.mkEnableOption "Doom Emacs configuration";
config = lib.mkMerge [
{
my.emacs.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = emacs.packages;
xdg.dataFile = {
"doom/templates/events.org".source = ../../../dotfiles/doom/templates/events.org;
"doom/templates/default.org".source = ../../../dotfiles/doom/templates/default.org;
"doom/templates/programming.org".source = ../../../dotfiles/doom/templates/programming.org;
};
services = {
lorri.enable = true;
emacs = {
enable = true;
defaultEditor = true;
};
};
programs.${shellType}.shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
edit = "emacsclient -t";
e = "edit";
};
programs.doom-emacs = {
enable = true;
doomDir = ../../../dotfiles/doom;
doomLocalDir = "${config.xdg.dataHome}/nix-doom";
tangleArgs = "--all config.org";
inherit (emacs) extraPackages;
};
})
];
}