initial commit
This commit is contained in:
36
users/modules/emacs.nix
Normal file
36
users/modules/emacs.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (
|
||||
epkgs: [
|
||||
epkgs.vterm
|
||||
epkgs.mu4e
|
||||
epkgs.pdf-tools
|
||||
]
|
||||
));
|
||||
cfg = config.modules.emacs;
|
||||
in {
|
||||
options.modules.emacs = {
|
||||
enable = lib.mkEnableOption "enables Emacs";
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = emacsDefaultPackage;
|
||||
};
|
||||
service = lib.mkEnableOption "enables Emacs service";
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.emacs = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
};
|
||||
services.emacs = lib.mkIf cfg.service {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
startWithUserSession = "graphical";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user