nixos/modules/dev/editors/emacs/default.nix

89 lines
2.1 KiB
Nix
Raw Normal View History

2023-09-04 12:59:43 +04:00
{
2023-09-16 11:52:57 +04:00
outputs,
options,
config,
lib,
pkgs,
2024-02-14 20:32:01 +04:00
types,
2023-12-25 13:27:36 +04:00
inputs,
2023-09-16 11:52:57 +04:00
...
}:
with lib; let
cfg = config.modules.dev.editors.emacs;
myEmacs = pkgs.emacsWithPackagesFromUsePackage {
config = ../../../../config/emacs/emacs.org;
2024-02-14 20:29:22 +04:00
package = cfg.type;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: [
epkgs.use-package
epkgs.mu4e
2024-02-04 13:03:36 +04:00
# TODO make this check if EXWM is enabled or not
epkgs.exwm
];
};
2023-09-16 11:52:57 +04:00
in {
2023-09-04 12:59:43 +04:00
options.modules.dev.editors.emacs = {
enable = mkEnableOption false;
2023-12-24 15:52:42 +04:00
daemon = mkEnableOption true;
2024-02-14 20:31:18 +04:00
package = mkOption {
2024-02-14 20:32:01 +04:00
type = types.package;
2024-02-14 20:31:00 +04:00
default = pkgs.emacs-unstable;
2024-02-14 20:29:49 +04:00
description = "pkgs. followed by the name of the emacs overlay package";
2024-02-14 20:19:37 +04:00
};
2023-09-04 12:59:43 +04:00
};
config = mkIf cfg.enable {
2023-12-26 15:02:02 +04:00
nixpkgs.overlays = [
inputs.emacs-overlay.overlay
];
# ues daemon
services.emacs = {
enable = cfg.daemon;
install = true;
# package = pkgs.emacs29-pgtk;
# package = pkgs.emacsWithPackagesFromUsePackage {
# config = ../../../../config/emacs/emacs.org;
# package = pkgs.emacs-unstable;
# alwaysEnsure = true;
# alwaysTangle = true;
# extraEmacsPackages = epkgs: [
# epkgs.use-package
# epkgs.mu4e
# ];
# };
package = myEmacs;
2023-12-26 15:02:02 +04:00
};
users.users.sako.packages = with pkgs; [
# direnv
direnv
2023-12-26 18:19:44 +04:00
# mu for email
mu
2023-12-26 18:40:34 +04:00
# sync
isync
2024-01-12 16:47:56 +04:00
# doc-view
unoconv
2024-01-20 12:01:08 +04:00
# org to pdf
# this might be bloat...
texliveFull
2023-12-26 15:02:02 +04:00
];
2023-12-25 22:59:05 +04:00
2023-12-26 15:02:02 +04:00
home-manager.users.sako = {lib, ...}: {
home.file = {
".emacs.d/init.el".source = pkgs.runCommand "init.el" {} ''
cp ${../../../../config/emacs/emacs.org} emacs.org
${pkgs.emacs}/bin/emacs -Q --batch ./emacs.org -f org-babel-tangle
mv init.el $out
'';
".emacs.d/dashboard.png".source = ../../../../config/emacs/dashboard.png;
};
};
2023-12-26 14:53:46 +04:00
2023-12-23 21:39:52 +04:00
fonts.packages = with pkgs; [
2023-09-16 11:52:57 +04:00
(nerdfonts.override {fonts = ["JetBrainsMono"];})
2023-10-05 07:37:12 +04:00
jetbrains-mono
2023-09-05 13:41:34 +04:00
];
2023-09-04 12:59:43 +04:00
};
}