about summary refs log tree commit diff
path: root/users/wpcarro/emacs/default.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2022-01-28T06·21-0800
committerclbot <clbot@tvl.fyi>2022-01-29T01·13+0000
commitaa502c3bafe089cde5ebe0a964d1bf435435fabe (patch)
treed6a4ab0dcf659bc78d489d732ce90f2f3c54a5bb /users/wpcarro/emacs/default.nix
parentcdc18c025a519c23fa4dd9e14781349fcdf4035f (diff)
feat(wpcarro/emacs): Support marcus.el r/3699
Sometimes I need device-specific Elisp. This is similar to what I'm doing in
google-briefcase (my gLinux-specific configuration).

Change-Id: Idc4031e74d31a91fb8d943acfaeb90b8742fbfc4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5084
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/wpcarro/emacs/default.nix')
-rw-r--r--users/wpcarro/emacs/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/users/wpcarro/emacs/default.nix b/users/wpcarro/emacs/default.nix
index 40e6f8d65d29..c2669f6949e5 100644
--- a/users/wpcarro/emacs/default.nix
+++ b/users/wpcarro/emacs/default.nix
@@ -3,12 +3,11 @@
 # TODO(wpcarro): See if it's possible to expose emacsclient on PATH, so that I
 # don't need to depend on wpcarros-emacs and emacs in my NixOS configurations.
 let
-  inherit (builtins) path;
   inherit (depot.third_party.nixpkgs) emacsPackagesGen emacs27;
   inherit (depot.users) wpcarro;
-  inherit (pkgs) runCommand writeShellScriptBin;
   inherit (lib) mapAttrsToList;
   inherit (lib.strings) concatStringsSep makeBinPath;
+  inherit (pkgs) runCommand writeShellScriptBin;
 
   emacsBinPath = makeBinPath (
     wpcarro.common.shell-utils ++
@@ -129,7 +128,7 @@ let
   makeEnvVars = env: concatStringsSep "\n"
     (mapAttrsToList (k: v: "export ${k}=\"${v}\"") env);
 
-  withEmacsPath = { emacsBin, env ? {} }:
+  withEmacsPath = { emacsBin, env ? {}, load ? [] }:
     writeShellScriptBin "wpcarros-emacs" ''
       export XMODIFIERS=emacs
       export PATH="${emacsBinPath}:$PATH"
@@ -141,12 +140,14 @@ let
         --no-site-file \
         --no-site-lisp \
         --load ${./.emacs.d/init.el} \
+        ${concatStringsSep "\n" (map (el: "--load ${el} \\") load)}
         "$@"
     '';
 in {
   inherit withEmacsPath;
 
-  nixos = withEmacsPath {
+  nixos = { load ? [] }: withEmacsPath {
+    inherit load;
     emacsBin = "${wpcarrosEmacs}/bin/emacs";
   };
 
@@ -166,5 +167,5 @@ in {
     touch $out
   '';
 
-  meta.targets = [ "nixos" "check" ];
+  meta.targets = [ "check" ];
 }