feat(wpcarro/emacs): Support marcus.el
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
This commit is contained in:
parent
cdc18c025a
commit
aa502c3baf
3 changed files with 47 additions and 6 deletions
|
|
@ -3,12 +3,11 @@
|
||||||
# TODO(wpcarro): See if it's possible to expose emacsclient on PATH, so that I
|
# 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.
|
# don't need to depend on wpcarros-emacs and emacs in my NixOS configurations.
|
||||||
let
|
let
|
||||||
inherit (builtins) path;
|
|
||||||
inherit (depot.third_party.nixpkgs) emacsPackagesGen emacs27;
|
inherit (depot.third_party.nixpkgs) emacsPackagesGen emacs27;
|
||||||
inherit (depot.users) wpcarro;
|
inherit (depot.users) wpcarro;
|
||||||
inherit (pkgs) runCommand writeShellScriptBin;
|
|
||||||
inherit (lib) mapAttrsToList;
|
inherit (lib) mapAttrsToList;
|
||||||
inherit (lib.strings) concatStringsSep makeBinPath;
|
inherit (lib.strings) concatStringsSep makeBinPath;
|
||||||
|
inherit (pkgs) runCommand writeShellScriptBin;
|
||||||
|
|
||||||
emacsBinPath = makeBinPath (
|
emacsBinPath = makeBinPath (
|
||||||
wpcarro.common.shell-utils ++
|
wpcarro.common.shell-utils ++
|
||||||
|
|
@ -129,7 +128,7 @@ let
|
||||||
makeEnvVars = env: concatStringsSep "\n"
|
makeEnvVars = env: concatStringsSep "\n"
|
||||||
(mapAttrsToList (k: v: "export ${k}=\"${v}\"") env);
|
(mapAttrsToList (k: v: "export ${k}=\"${v}\"") env);
|
||||||
|
|
||||||
withEmacsPath = { emacsBin, env ? {} }:
|
withEmacsPath = { emacsBin, env ? {}, load ? [] }:
|
||||||
writeShellScriptBin "wpcarros-emacs" ''
|
writeShellScriptBin "wpcarros-emacs" ''
|
||||||
export XMODIFIERS=emacs
|
export XMODIFIERS=emacs
|
||||||
export PATH="${emacsBinPath}:$PATH"
|
export PATH="${emacsBinPath}:$PATH"
|
||||||
|
|
@ -141,12 +140,14 @@ let
|
||||||
--no-site-file \
|
--no-site-file \
|
||||||
--no-site-lisp \
|
--no-site-lisp \
|
||||||
--load ${./.emacs.d/init.el} \
|
--load ${./.emacs.d/init.el} \
|
||||||
|
${concatStringsSep "\n" (map (el: "--load ${el} \\") load)}
|
||||||
"$@"
|
"$@"
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
inherit withEmacsPath;
|
inherit withEmacsPath;
|
||||||
|
|
||||||
nixos = withEmacsPath {
|
nixos = { load ? [] }: withEmacsPath {
|
||||||
|
inherit load;
|
||||||
emacsBin = "${wpcarrosEmacs}/bin/emacs";
|
emacsBin = "${wpcarrosEmacs}/bin/emacs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -166,5 +167,5 @@ in {
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta.targets = [ "nixos" "check" ];
|
meta.targets = [ "check" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (depot.users) wpcarro;
|
inherit (depot.users) wpcarro;
|
||||||
wpcarrosEmacs = wpcarro.emacs.nixos;
|
|
||||||
|
wpcarrosEmacs = wpcarro.emacs.nixos {
|
||||||
|
load = [ ./marcus.el ];
|
||||||
|
};
|
||||||
|
|
||||||
quasselClient = pkgs.quassel.override {
|
quasselClient = pkgs.quassel.override {
|
||||||
client = true;
|
client = true;
|
||||||
|
|
|
||||||
37
users/wpcarro/nixos/marcus/marcus.el
Normal file
37
users/wpcarro/nixos/marcus/marcus.el
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Dependencies
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(require 'display)
|
||||||
|
(require 'window-manager)
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Monitor Configuration
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(display-register laptop
|
||||||
|
:output "eDP-1"
|
||||||
|
:primary t
|
||||||
|
:coords (0 0)
|
||||||
|
:size (1920 1080)
|
||||||
|
:rate 30.0
|
||||||
|
:dpi 96
|
||||||
|
:rotate normal)
|
||||||
|
|
||||||
|
(display-arrangement primary :displays (laptop))
|
||||||
|
|
||||||
|
(setq window-manager-named-workspaces
|
||||||
|
(list (make-window-manager-named-workspace
|
||||||
|
:label "Web Browsing"
|
||||||
|
:kbd "c"
|
||||||
|
:display display-laptop)
|
||||||
|
(make-window-manager-named-workspace
|
||||||
|
:label "Coding"
|
||||||
|
:kbd "d"
|
||||||
|
:display display-laptop)
|
||||||
|
(make-window-manager-named-workspace
|
||||||
|
:label "Chatting"
|
||||||
|
:kbd "h"
|
||||||
|
:display display-laptop)))
|
||||||
|
|
||||||
|
(window-manager-init :init-hook #'display-arrange-primary)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue