2021-11-08 22:01:07 +01:00
|
|
|
{ pkgs, config, lib, secret, ... }:
|
2021-04-11 00:25:36 +02:00
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.magic_rb.programs.emacs;
|
|
|
|
inherit (config.magic_rb.pkgs) nixpkgs;
|
|
|
|
in
|
2020-12-26 23:36:50 +01:00
|
|
|
{
|
2021-04-11 00:25:36 +02:00
|
|
|
options.magic_rb.programs.emacs = {
|
|
|
|
enable = mkEnableOption "Enable emacs with my config";
|
|
|
|
package = mkOption {
|
|
|
|
description = "Which emacs package to use.";
|
|
|
|
type = types.package;
|
2021-09-07 07:55:53 +02:00
|
|
|
default =
|
2021-10-05 21:46:44 +02:00
|
|
|
let
|
|
|
|
# gensymb is not here, dont add
|
|
|
|
tex = with pkgs;
|
|
|
|
texlive.combine
|
|
|
|
{ inherit (texlive)
|
2021-10-29 12:54:02 +02:00
|
|
|
scheme-full;
|
2021-10-05 21:46:44 +02:00
|
|
|
};
|
|
|
|
r = with pkgs;
|
|
|
|
rWrapper.override
|
|
|
|
{ packages = with rPackages; [ ggplot2 ]; };
|
|
|
|
in
|
|
|
|
(nixpkgs.magic_rb.emacs.override
|
|
|
|
{ march = config.magic_rb.optimisation.march;
|
|
|
|
hunspell.enable = true;
|
|
|
|
hunspell.dictionaries = with pkgs.hunspellDicts;
|
|
|
|
[ en_US ];
|
2021-11-08 22:01:07 +01:00
|
|
|
environment =
|
|
|
|
{ MU4E_CONTEXTS = secret.emacs.mu4eContexts;
|
|
|
|
};
|
2021-10-17 19:59:52 +02:00
|
|
|
additionalPackages =
|
|
|
|
[ tex
|
|
|
|
r
|
|
|
|
] ++
|
|
|
|
(with pkgs;
|
|
|
|
[ krita
|
|
|
|
ripgrep
|
2021-11-08 22:01:07 +01:00
|
|
|
mu isync
|
2022-03-12 23:06:42 +01:00
|
|
|
exa
|
2021-10-17 19:59:52 +02:00
|
|
|
]);
|
2021-10-05 21:46:44 +02:00
|
|
|
}).bundle;
|
2020-12-26 23:36:50 +01:00
|
|
|
};
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
cfg.package
|
2021-10-17 19:59:52 +02:00
|
|
|
(makeDesktopItem {
|
|
|
|
name = "Org-Protocol";
|
|
|
|
exec = "emacsclient %u";
|
|
|
|
comment = "Org protocol";
|
|
|
|
desktopName = "org-protocol";
|
|
|
|
type = "Application";
|
|
|
|
mimeType = "x-scheme-handler/org-protocol";
|
|
|
|
})
|
|
|
|
|
2021-04-11 00:25:36 +02:00
|
|
|
fira-code
|
2021-06-13 20:37:33 +02:00
|
|
|
(iosevka-bin.override { variant = "aile"; })
|
|
|
|
(iosevka-bin.override { variant = "etoile"; })
|
|
|
|
(iosevka-bin.override { variant = ""; })
|
2021-04-11 00:25:36 +02:00
|
|
|
emacs-all-the-icons-fonts
|
|
|
|
];
|
|
|
|
|
2021-04-25 13:07:35 +02:00
|
|
|
home.activation.emacsStraightVerions = config.lib.dag.entryAfter
|
|
|
|
["writeBoundary"] ''
|
|
|
|
mkdir -p ~/.emacs.d/straight/versions
|
|
|
|
ln -sfn ~/dotfiles/nix/home-manager/modules/emacs/straight-versions.el ~/.emacs.d/straight/versions/default.el
|
|
|
|
'';
|
2021-10-05 21:46:44 +02:00
|
|
|
|
2021-04-11 00:25:36 +02:00
|
|
|
home.file = {
|
|
|
|
".emacs".source = ./.emacs;
|
2021-11-08 22:01:07 +01:00
|
|
|
".mbsyncrc".source = secret.emacs.mbsyncrc;
|
2021-04-11 00:25:36 +02:00
|
|
|
".emacs.d/org" = {
|
|
|
|
source = ./.emacs.d/org;
|
|
|
|
recursive = true;
|
|
|
|
};
|
|
|
|
".emacs.d/lisp" = {
|
|
|
|
source = ./.emacs.d/lisp;
|
|
|
|
recursive = true;
|
|
|
|
};
|
2021-12-22 23:49:00 +01:00
|
|
|
".emacs.d/mu4e-contexts" = {
|
|
|
|
source = secret.emacs.mu4eContexts;
|
|
|
|
};
|
|
|
|
".emacs.d/treesitter-grammars" = {
|
|
|
|
source = pkgs.tree-sitter.withPlugins (p: builtins.attrValues p);
|
|
|
|
};
|
2020-12-26 23:36:50 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|