2020-09-02 15:05:20 +02:00
|
|
|
{ pkgs, depot, ... }:
|
2020-01-06 15:58:22 +01:00
|
|
|
|
|
|
|
let
|
2020-08-31 12:31:00 +02:00
|
|
|
inherit (builtins) path;
|
2020-09-02 15:05:20 +02:00
|
|
|
inherit (depot.third_party) emacsPackagesGen emacs27;
|
|
|
|
inherit (pkgs) writeShellScript writeShellScriptBin;
|
2020-09-07 11:52:54 +02:00
|
|
|
inherit (pkgs.lib.strings) concatStringsSep makeBinPath;
|
2020-08-31 12:31:00 +02:00
|
|
|
|
|
|
|
emacsBinPath = makeBinPath (with pkgs; [
|
|
|
|
tdesktop
|
2020-02-06 23:23:09 +01:00
|
|
|
ripgrep
|
2020-09-08 00:01:59 +02:00
|
|
|
bat
|
|
|
|
fd
|
2020-09-08 00:23:08 +02:00
|
|
|
fzf
|
2020-09-08 00:01:59 +02:00
|
|
|
pass
|
|
|
|
tokei
|
|
|
|
nmap
|
|
|
|
tldr
|
|
|
|
diskus
|
|
|
|
jq
|
|
|
|
pup
|
|
|
|
exa
|
2020-02-06 23:23:09 +01:00
|
|
|
gitAndTools.hub
|
|
|
|
kubectl
|
|
|
|
google-cloud-sdk
|
|
|
|
xsv
|
Remove assertions that prelude/executable-exists?
I'm in the midst of transitioning onto a few new tools.
My previous workflow just used `nix-env` to install *some* packages. I didn't
have a prescribed methodology for which packages I would install using `nix-env`
and which ones I would install using `sudo apt-get install`. Sometimes if a
package would be available in my aptitude repositories, I'd use that; other
times when it wasn't available I'd use `nix-env`. One complication about being
on gLinux intead of NixOS is that some packages (e.g. nixpkgs.terminator) is
available via `nix-env -iA nixpkgs.terminator`, but the installation won't
actually run on my gLinux. In these instances, I would install terminator from
the aptitude repositories.
Then @tazjin introduced me to his Emacs configuration that he builds using
Nix. What appealed to me about his built Emacs is that it worked as expected on
either a NixOS machine and on gLinux (and presumably on other non-NixOS machines
as well).
A setup towards which I'm working is to own one or a few NixOS machines whose
configurations are entirely managed with Nix. On devices like my work machines,
which cannot run NixOS, I can build as much of the software that I need using
Nix and attempt to minimize the ad hoc configuration either with shell scripts,
python, golang, or more Nix code... it's clear that I still don't have a clear
idea of how that part will work.
For now, I'm adopting nix, nix-env, lorri, direnv, and weening off of aptitude
as much as I can. Things are a bit messy, but my general trend feels
positive. Stay tuned for more updates.
2020-02-06 22:44:26 +01:00
|
|
|
scrot
|
|
|
|
clipmenu
|
2020-08-31 12:31:57 +02:00
|
|
|
xorg.xset
|
2020-09-07 17:20:41 +02:00
|
|
|
direnv
|
2020-09-07 20:51:08 +02:00
|
|
|
nix
|
Remove assertions that prelude/executable-exists?
I'm in the midst of transitioning onto a few new tools.
My previous workflow just used `nix-env` to install *some* packages. I didn't
have a prescribed methodology for which packages I would install using `nix-env`
and which ones I would install using `sudo apt-get install`. Sometimes if a
package would be available in my aptitude repositories, I'd use that; other
times when it wasn't available I'd use `nix-env`. One complication about being
on gLinux intead of NixOS is that some packages (e.g. nixpkgs.terminator) is
available via `nix-env -iA nixpkgs.terminator`, but the installation won't
actually run on my gLinux. In these instances, I would install terminator from
the aptitude repositories.
Then @tazjin introduced me to his Emacs configuration that he builds using
Nix. What appealed to me about his built Emacs is that it worked as expected on
either a NixOS machine and on gLinux (and presumably on other non-NixOS machines
as well).
A setup towards which I'm working is to own one or a few NixOS machines whose
configurations are entirely managed with Nix. On devices like my work machines,
which cannot run NixOS, I can build as much of the software that I need using
Nix and attempt to minimize the ad hoc configuration either with shell scripts,
python, golang, or more Nix code... it's clear that I still don't have a clear
idea of how that part will work.
For now, I'm adopting nix, nix-env, lorri, direnv, and weening off of aptitude
as much as I can. Things are a bit messy, but my general trend feels
positive. Stay tuned for more updates.
2020-02-06 22:44:26 +01:00
|
|
|
]);
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2020-09-02 15:05:20 +02:00
|
|
|
emacsWithPackages = (emacsPackagesGen emacs27).emacsWithPackages;
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2020-01-06 15:58:22 +01:00
|
|
|
wpcarrosEmacs = emacsWithPackages (epkgs:
|
|
|
|
(with epkgs.elpaPackages; [
|
|
|
|
exwm
|
|
|
|
]) ++
|
|
|
|
|
|
|
|
(with epkgs.melpaPackages; [
|
2020-08-19 17:16:31 +02:00
|
|
|
org-bullets
|
|
|
|
sly
|
2020-03-06 12:25:54 +01:00
|
|
|
notmuch
|
2020-04-11 18:45:59 +02:00
|
|
|
elm-mode
|
2020-02-10 12:34:19 +01:00
|
|
|
ts
|
2020-02-08 17:00:31 +01:00
|
|
|
vterm
|
2020-01-06 15:58:22 +01:00
|
|
|
base16-theme
|
2020-09-02 15:05:20 +02:00
|
|
|
password-store
|
2020-01-06 15:58:22 +01:00
|
|
|
clipmon # TODO: Prefer an Emacs client for clipmenud.
|
|
|
|
evil
|
|
|
|
evil-collection
|
|
|
|
evil-magit
|
|
|
|
evil-commentary
|
|
|
|
evil-surround
|
|
|
|
key-chord
|
|
|
|
add-node-modules-path # TODO: Assess whether or not I need this with Nix.
|
|
|
|
web-mode
|
|
|
|
rjsx-mode
|
|
|
|
tide
|
|
|
|
prettier-js
|
|
|
|
flycheck
|
|
|
|
diminish
|
|
|
|
doom-themes
|
2020-07-06 12:11:08 +02:00
|
|
|
telephone-line
|
2020-01-06 15:58:22 +01:00
|
|
|
which-key
|
2020-11-12 12:20:27 +01:00
|
|
|
all-the-icons
|
|
|
|
all-the-icons-ivy
|
2020-01-06 15:58:22 +01:00
|
|
|
ivy
|
2020-11-12 12:20:27 +01:00
|
|
|
ivy-pass
|
|
|
|
ivy-prescient
|
2020-01-31 13:45:48 +01:00
|
|
|
restclient
|
|
|
|
package-lint
|
|
|
|
parsec
|
|
|
|
magit-popup
|
|
|
|
direnv
|
2020-01-06 15:58:22 +01:00
|
|
|
alert
|
|
|
|
nix-mode
|
|
|
|
racer
|
|
|
|
rust-mode
|
|
|
|
rainbow-delimiters
|
|
|
|
racket-mode
|
|
|
|
lispyville
|
|
|
|
elisp-slime-nav
|
|
|
|
py-yapf
|
|
|
|
reason-mode
|
|
|
|
elixir-mode
|
2020-02-05 18:55:38 +01:00
|
|
|
go-mode
|
2020-01-06 15:58:22 +01:00
|
|
|
company
|
|
|
|
markdown-mode
|
|
|
|
refine
|
|
|
|
deferred
|
|
|
|
magit
|
|
|
|
request
|
|
|
|
pcre2el
|
|
|
|
helpful
|
|
|
|
exec-path-from-shell # TODO: Determine if Nix solves this problem.
|
|
|
|
yasnippet
|
|
|
|
projectile
|
|
|
|
deadgrep
|
|
|
|
counsel
|
|
|
|
counsel-projectile
|
|
|
|
engine-mode # TODO: Learn what this is.
|
|
|
|
eglot
|
|
|
|
dap-mode
|
|
|
|
lsp-ui
|
|
|
|
company-lsp
|
|
|
|
suggest
|
|
|
|
paradox
|
|
|
|
flymake-shellcheck
|
|
|
|
fish-mode
|
|
|
|
tuareg
|
|
|
|
haskell-mode
|
|
|
|
lsp-haskell
|
|
|
|
use-package
|
|
|
|
general
|
|
|
|
clojure-mode
|
|
|
|
cider
|
|
|
|
f
|
|
|
|
dash
|
|
|
|
company
|
|
|
|
counsel
|
|
|
|
flycheck
|
|
|
|
]));
|
|
|
|
|
2020-08-31 12:31:00 +02:00
|
|
|
vendorDir = path {
|
2020-08-27 00:01:35 +02:00
|
|
|
path = ./.emacs.d/vendor;
|
|
|
|
name = "emacs-vendor";
|
|
|
|
};
|
|
|
|
|
2020-11-12 12:20:27 +01:00
|
|
|
# TODO: byte-compile these by packaging each as an Elisp library.
|
2020-08-31 12:31:00 +02:00
|
|
|
wpcDir = path {
|
2020-08-27 00:01:35 +02:00
|
|
|
path = ./.emacs.d/wpc;
|
|
|
|
name = "emacs-libs";
|
|
|
|
};
|
|
|
|
|
2020-08-31 12:31:00 +02:00
|
|
|
wpcPackageEl = path {
|
2020-08-27 00:01:35 +02:00
|
|
|
path = ./.emacs.d/wpc/wpc-package.el;
|
|
|
|
name = "wpc-package.el";
|
|
|
|
};
|
|
|
|
|
2020-08-31 12:31:00 +02:00
|
|
|
initEl = path {
|
2020-08-27 00:01:35 +02:00
|
|
|
path = ./.emacs.d/init.el;
|
|
|
|
name = "init.el";
|
|
|
|
};
|
|
|
|
|
2020-09-07 11:52:54 +02:00
|
|
|
loadPath = concatStringsSep ":" [
|
|
|
|
wpcDir
|
|
|
|
vendorDir
|
|
|
|
# TODO: Explain why the trailing ":" is needed.
|
|
|
|
"${wpcarrosEmacs.deps}/share/emacs/site-lisp:"
|
|
|
|
];
|
|
|
|
|
|
|
|
withEmacsPath = { emacsBin, briefcasePath ? "$HOME/briefcase" }:
|
2020-08-31 12:31:00 +02:00
|
|
|
writeShellScriptBin "wpcarros-emacs" ''
|
2020-08-31 02:16:31 +02:00
|
|
|
export XMODIFIERS=emacs
|
|
|
|
export BRIEFCASE=${briefcasePath}
|
2020-09-07 20:49:44 +02:00
|
|
|
export GOOGLE_BRIEFCASE="$HOME/google-briefcase"
|
2020-08-31 02:16:31 +02:00
|
|
|
export PATH="${emacsBinPath}:$PATH"
|
2020-09-07 11:52:54 +02:00
|
|
|
export EMACSLOADPATH="${loadPath}"
|
2020-08-31 02:16:31 +02:00
|
|
|
exec ${emacsBin} \
|
|
|
|
--debug-init \
|
2020-11-12 12:20:27 +01:00
|
|
|
--no-init-file \
|
2020-08-31 02:16:31 +02:00
|
|
|
--no-site-file \
|
|
|
|
--no-site-lisp \
|
|
|
|
--load ${initEl} \
|
|
|
|
"$@"
|
|
|
|
'';
|
2020-04-02 15:37:47 +02:00
|
|
|
in {
|
2020-09-07 11:52:54 +02:00
|
|
|
inherit initEl withEmacsPath;
|
2020-08-27 19:27:12 +02:00
|
|
|
|
|
|
|
# I need to start my Emacs from CI without the call to `--load ${initEl}`.
|
2020-08-31 02:16:31 +02:00
|
|
|
runScript = { script, briefcasePath }:
|
2020-08-31 12:31:00 +02:00
|
|
|
writeShellScript "run-emacs-script" ''
|
2020-08-31 02:16:31 +02:00
|
|
|
export BRIEFCASE=${briefcasePath}
|
|
|
|
export PATH="${emacsBinPath}:$PATH"
|
|
|
|
export EMACSLOADPATH="${wpcDir}:${vendorDir}:${wpcarrosEmacs.deps}/share/emacs/site-lisp"
|
|
|
|
exec ${wpcarrosEmacs}/bin/emacs \
|
|
|
|
--no-site-file \
|
|
|
|
--no-site-lisp \
|
|
|
|
--no-init-file \
|
|
|
|
--script ${script} \
|
|
|
|
"$@"
|
|
|
|
'';
|
2020-08-27 19:27:12 +02:00
|
|
|
|
2020-04-02 15:37:47 +02:00
|
|
|
# Use `nix-env -f '<briefcase>' emacs.nixos` to install `wpcarros-emacs` on
|
|
|
|
# NixOS machines.
|
2020-08-31 02:16:31 +02:00
|
|
|
nixos = { briefcasePath ? "$HOME/briefcase" }: withEmacsPath {
|
|
|
|
inherit briefcasePath;
|
|
|
|
emacsBin = "${wpcarrosEmacs}/bin/emacs";
|
|
|
|
};
|
2020-04-02 15:37:47 +02:00
|
|
|
}
|