base: Finally, some emacs on darwin (and some other stuff I guess)
This commit is contained in:
parent
5467282626
commit
15586a8f7c
81 changed files with 469 additions and 417 deletions
|
@ -1,57 +1,18 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
username = config.chvp.username;
|
||||
in
|
||||
{
|
||||
options.chvp.base.emacs = {
|
||||
fullConfig = lib.mkOption {
|
||||
readOnly = true;
|
||||
default = builtins.readFile ./base-init.el + (lib.concatStringsSep "\n" config.chvp.base.emacs.extraConfig) + ''
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
'';
|
||||
};
|
||||
extraConfig = lib.mkOption {
|
||||
default = [ ];
|
||||
};
|
||||
package = lib.mkOption {
|
||||
readOnly = true;
|
||||
default = pkgs.emacsWithPackagesFromUsePackage {
|
||||
config = config.chvp.base.emacs.fullConfig;
|
||||
package = pkgs.emacs-pgtk;
|
||||
alwaysEnsure = true;
|
||||
extraEmacsPackages = epkgs: lib.optional config.chvp.graphical.mail.enable epkgs.mu4e;
|
||||
};
|
||||
};
|
||||
chvp.base.emacs = {
|
||||
basePackage = pkgs.emacs-pgtk;
|
||||
};
|
||||
|
||||
config = {
|
||||
chvp.base.zfs.homeLinks = [
|
||||
{ path = ".cache/emacs"; type = "cache"; }
|
||||
];
|
||||
|
||||
services.languagetool = {
|
||||
home-manager.users.${username} = { ... }: {
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
port = 15151;
|
||||
settings.cacheSize = 10000;
|
||||
};
|
||||
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
client.enable = true;
|
||||
socketActivation.enable = true;
|
||||
package = config.chvp.base.emacs.package;
|
||||
};
|
||||
home = {
|
||||
packages = [
|
||||
(pkgs.writeShellScriptBin "emacs" ''${config.chvp.base.emacs.package}/bin/emacsclient -c "$@"'')
|
||||
(pkgs.writeShellScriptBin "emacsclient" ''${config.chvp.base.emacs.package}/bin/emacsclient "$@"'')
|
||||
];
|
||||
sessionVariables = { EDITOR = "emacs"; };
|
||||
};
|
||||
xdg.configFile = {
|
||||
"emacs/init.el".text = config.chvp.base.emacs.fullConfig;
|
||||
"emacs/early-init.el".source = ./early-init.el;
|
||||
};
|
||||
client.enable = true;
|
||||
socketActivation.enable = true;
|
||||
package = config.chvp.base.emacs.package;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue