82 lines
2.1 KiB
Nix
82 lines
2.1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
shellAliases = {
|
|
e = "emacsclient -t"; # Terminal
|
|
ew = "emacsclient -c"; # New window (and wait)
|
|
en = "emacsclient -nc"; # New window (and return immediately)
|
|
calc = "emacs -f full-calc -nw -q"; # Quick fullscreen calculator
|
|
|
|
doom = "~/.emacs.d/bin/doom";
|
|
};
|
|
in {
|
|
programs.doom-emacs = rec {
|
|
enable = true;
|
|
doomPrivateDir = pkgs.callPackage ./doom.d { };
|
|
|
|
# Only init/packages so we only rebuild when those change.
|
|
doomPackageDir = let
|
|
filteredPath = builtins.path {
|
|
path = doomPrivateDir;
|
|
name = "doom-private-dir-filtered";
|
|
filter = path: type:
|
|
# builtins.elem (baseNameOf path) [ "init.el" "packages.el" "modules" ];
|
|
let
|
|
relPath =
|
|
lib.removePrefix (toString doomPrivateDir + "/") (toString path);
|
|
regexes = [ "init.el" "packages.el" "modules(/.*)?" ];
|
|
in lib.any (re: builtins.match re relPath != null) regexes;
|
|
};
|
|
in pkgs.linkFarm "doom-packages-dir" [
|
|
{
|
|
name = "init.el";
|
|
path = "${filteredPath}/init.el";
|
|
}
|
|
{
|
|
name = "packages.el";
|
|
path = "${filteredPath}/packages.el";
|
|
}
|
|
{
|
|
name = "modules";
|
|
path = "${filteredPath}/modules";
|
|
}
|
|
{
|
|
name = "config.el";
|
|
path = pkgs.emptyFile;
|
|
}
|
|
];
|
|
};
|
|
|
|
home.packages = with pkgs;
|
|
let py = python3Packages;
|
|
in [
|
|
editorconfig-core-c
|
|
cask
|
|
mypy
|
|
pyright
|
|
haskell-language-server
|
|
rustup
|
|
texlab
|
|
|
|
(pkgs.makeDesktopItem {
|
|
name = "org-protocol";
|
|
desktopName = "Emacs org-protocol handler";
|
|
exec = "emacsclient %u";
|
|
terminal = false;
|
|
categories = [ "System" ];
|
|
mimeTypes = [ "x-scheme-handler/org-protocol" ];
|
|
})
|
|
];
|
|
|
|
programs.firefox.profiles.default.settings = {
|
|
"network.protocol-handler.expose.org-protocol" = false;
|
|
};
|
|
|
|
programs.zsh = { inherit shellAliases; };
|
|
programs.xonsh = { inherit shellAliases; };
|
|
|
|
services.gpg-agent.extraConfig = ''
|
|
allow-emacs-pinentry
|
|
'';
|
|
}
|