xin/configs/emacs.nix

43 lines
987 B
Nix
Raw Normal View History

{ pkgs
, isUnstable
, lib
, config
2023-09-12 08:44:05 -06:00
, ...
}:
let
myEmacs = pkgs.callPackage ../pkgs/emacs.nix { inherit isUnstable; };
cfg = config.myEmacs;
editorScript = pkgs.writeShellScriptBin "emacseditor" ''
if [ -z "$1" ]; then
exec ${myEmacs}/bin/emacsclient --create-frame --alternate-editor ${myEmacs}/bin/emacs
else
exec ${myEmacs}/bin/emacsclient --alternate-editor ${myEmacs}/bin/emacs "$@"
fi
'';
in
{
options = {
myEmacs = {
enable = lib.mkOption {
description = "Enable my emacs stuff";
default = true;
};
};
};
config = lib.mkIf cfg.enable {
environment = {
variables.EDITOR = lib.mkOverride 900 "emacseditor";
systemPackages = with pkgs; [
(aspellWithDicts (dicts: with dicts; [ en en-computers es de ]))
go-font
graphviz
2022-08-25 12:21:35 -06:00
myEmacs
editorScript
]
++ lib.optionals (pkgs.system == "x86_64-linux") [ texlive.combined.scheme-full ];
2024-07-12 08:39:40 -06:00
};
};
2023-09-12 08:44:05 -06:00
}