Arroyo developed out of a system originally designed to assemble an Emacs init.el, and now it has some super-powers. The Arroyo Emacs configuration is pretty opinionated as it's a system designed to work around Evil Mode and EXWM .
Arroyo Emacs configuration is designed to work closely with the Arroyo Home Manager generator, nearly all system dependencies are installed through Home Manager, and certain submodules may require the use of Home Manager. No Arroyo Emacs features should require running NixOS though, and I'd like to maintain that as much as possible since getting Nix running everywhere is much more feasible than running NixOS everywhere.
Users of the Arroyo Home Manager generator will have access to features available in nix-community/emacs-overlay like:
the
native-compilefeatureNative GTK with Wayland support
When using
use-package, packages will be downloaded and (natively!) compiled in the deploy phase rather than on Emacs startup
arroyo-emacs-generate-init is now managed in Arcology's Arroyo Emacs =init.el= Generator
Emacs Overlay in my Flake Generator
The Arroyo System Flake Generator input just tracks upstream:
nix source: :tangle ~/nix/snippets/emacs-overlay-input.nix :mkdirp yesemacs-overlay = { url = "github:nix-community/emacs-overlay"; inputs.nixpkgs.follows = "nixpkgs"; };
And is installed as an overlay:
nix source: :tangle ~/nix/snippets/emacs-overlay.nix :mkdirp yesinputs.emacs-overlay.overlays.default
Arroyo Home Manager support for customized Emacs package
This Nix home-manager import installs Emacs with my generated init.el file included, packages installed, and custom overrides included. Source revisions are pinned by the Arroyo System Flake 's flake.lock and exposed to packages and epkg overrides via the inputs argument threaded through rixpkgs-overlay.
The Emacs package uses, currently 28.0.90 which supports native compilation -- the so-called GccEmacs and the packages from the init.el, natively compiled and ready to go. This is overlayed in to nixpkgs using Arroyo Nix Support
nix source: :tangle ~/nix/pkgs/emacs.nix :noweb yes -r{ inputs, pkgs, lib ? pkgs.lib, init ? ../files/init.el, ... }: pkgs.emacsWithPackagesFromUsePackage { package = pkgs.emacs-unstable-pgtk; config = init; alwaysEnsure = true; override = epkgs: epkgs // rec { <<generate_epkg_overrides()>> }; extraEmacsPackages = epkgs: [ epkgs.consult-org-roam ]; }
nix source: :tangle ~/nix/hm/emacs.nix :noweb yes -r{ config, pkgs, lib, ...}: let myEmacs = pkgs.myEmacs; # loads via overlay in { home.file.".emacs.d/init.el".source = ../files/init.el; programs.info.enable = true; services.emacs = { enable = false; package = myEmacs; }; programs.emacs = { enable = true; package = myEmacs; }; }
Literate Programming helpers
I want to be able to construct a home-manager import dynamically which can be used to install with emacs-overlay functionality. I also want it to be able to inject arbitrary packageOverrides in to it via references in stored in documents' ARROYO_HOME_EPKGS property keyword.
arroyo-epkg-overrides can be used to insert any overridden elisp package in to the registry for use-package to install, including things with patches or personal forks. yummy. apply a ARROYO_HOME_EPKGS keyword to the page to include it here.
generate_epkg_overrideslua source: :eval arroyo :results rawlocal overrides = arroyo.epkg_overrides() return table.concat(overrides, "\n")
The init.el itself is generated by arroyo.emacs_init() which reads all ARROYO_EMACS_MODULE snippets in topological order (resolving ARROYO_MODULE_WANTS and ARROYO_MODULE_WANTED dependencies) and concatenates their file contents:
generate-init-ellua source: :eval arroyo :results rawreturn arroyo.emacs_init()
emacs-lisp source: :tangle ~/nix/files/init.el :mkdirp yes :noweb yes :comments none<<generate-init-el()>>
NEXT EPKGs definitions can go missing
If a page has an ARROYO_SYSTEM_ROLE to constrain software to the wobserver, for example, it will be hard to add epkgs; they should not be role-specialized since the emacs init isn't. Fix this in the Arroyo Emacs Generator .
NEXT fix ccache support
DONE reenable ccache
https://github.com/NixOS/nixpkgs/pull/137936
NEXT how to automate epkg tangling, etc.
can use org-roam 's Arcology.Roam.File to know whether a file has been updated and tangle it as part of the dynamic-home-manager dynamic-nixops etc... those things will check a cache to see if the files have changed, and tangle them and then this file if so?
DONE need a reverse of ARROYO_MODULE_WANTS for specifying "wanted-by"s
emacs-lisp source:(provide 'arroyo-emacs)