Attempts to select the right emacs package based on whether the machine is x11 only or not.
68 lines
1.7 KiB
Nix
68 lines
1.7 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
doomSync = (let
|
|
git = pkgs.git;
|
|
in ''
|
|
export PATH=${pkgs.emacs}/bin:${git}/bin:$PATH
|
|
${config.xdg.configHome}/emacs/bin/doom sync -u -j $((`nproc`/4*3))
|
|
'');
|
|
in {
|
|
config = {
|
|
home.packages = [
|
|
pkgs.emacs-all-the-icons-fonts
|
|
pkgs.fontconfig
|
|
pkgs.graphviz
|
|
pkgs.isort
|
|
pkgs.nerdfonts
|
|
pkgs.nil # nix lsp language server
|
|
pkgs.nixfmt-rfc-style
|
|
(pkgs.ripgrep.override {withPCRE2 = true;})
|
|
pkgs.pipenv
|
|
pkgs.poetry
|
|
pkgs.python3
|
|
];
|
|
|
|
fonts.fontconfig.enable = true;
|
|
|
|
home.file = {
|
|
".config/emacs" = {
|
|
source = fetchGit {
|
|
url = "https://github.com/doomemacs/doomemacs.git";
|
|
# When updating me, remember to run `doom sync`
|
|
rev = "ac1122ae67d762e09fc6684945b52adff96cf1dc";
|
|
};
|
|
# We need to use recursive mode here or else doom fails to sync for
|
|
# some reason related to the permissions on the synced path. I'm not
|
|
# quite sure of everything that's going on here.
|
|
recursive = true;
|
|
|
|
# Because `recursive = true` will cause this to sync every single
|
|
# activation, we turn this off here.
|
|
#
|
|
# There's probably a way we could do better detection of this within
|
|
# our onChange shell?
|
|
#
|
|
# onChange = doomSync;
|
|
};
|
|
};
|
|
|
|
home.sessionVariables = {
|
|
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
|
|
EDITOR = "emacs -nw";
|
|
};
|
|
|
|
home.sessionPath = [
|
|
"${config.xdg.configHome}/emacs/bin"
|
|
];
|
|
|
|
xdg.configFile."doom" = {
|
|
source = ./doom;
|
|
# Sync doom if we updated the config
|
|
onChange = doomSync;
|
|
};
|
|
};
|
|
}
|