split home-manager into their own submodules
This commit is contained in:
61
modules/dev/emacs/home.nix
Normal file
61
modules/dev/emacs/home.nix
Normal 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;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user