First working doom emacs config

This commit is contained in:
marc
2022-11-13 17:46:29 +01:00
parent 4577adc53f
commit f2f5227384
10 changed files with 232 additions and 74 deletions

View File

@@ -17,6 +17,7 @@
samfelag.modules = {
user.name = "marc";
bluetooth.enable = true;
editors.emacs.enable = true;
};

View File

@@ -2,5 +2,6 @@
{
imports = [
./emacs.nix
];
}

View File

@@ -0,0 +1,119 @@
{ config, inputs, lib, options, pkgs, ... }:
with lib;
let
cfg = config.samfelag.modules.editors.emacs;
in {
options.samfelag.modules.editors.emacs = {
enable = mkEnableOption "emacs";
};
config = mkIf cfg.enable {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
# home.file.doom-emacs = {
# source = ./doom-emacs;
# target = ".config/doom";
# recursive = true;
# # onChange = "doom upgrade";
# };
# home.programs.emacs = {
# enable = true;
# # package = pkgs.emacsPgtkGcc;
# extraPackages = epkgs: [ epkgs.vterm ];
# };
# home.services.emacs = {
# enable = true;
# client.enable = true;
# socketActivation.enable = true;
# };
environment.systemPackages = with pkgs; [
## Emacs itself
binutils
emacs
# emacsPgtkGcc
## Doom dependencies
git
(ripgrep.override { withPCRE2 = true; })
gnutls
## Opt deps
fd
imagemagick
pinentry_emacs
zstd
# ## Modules deps
# # :lang cc
# ccls
# cmake
# gcc
# glslang
# # :lang haskell
# stack
# haskellPackages.ghcide
# haskellPackages.hoogle
# # :lang latex && :lang org (latex preview)
# (texlive.combine { inherit (texlive) scheme-full; })
# # biber
# # :lang nix
# nixfmt
# # :lang python
# black
# python3
# python3Packages.isort
# # python3Packages.python-language-server
# python3Packages.pytest
# python3Packages.setuptools
# nodePackages.pyright
# # :tools lookup & :lang org +roam
# sqlite
# # :tools direnv
# direnv
# # :tools vterm
# gcc
# gnumake
# libtool
# Fonts
emacs-all-the-icons-fonts
# fira-code
# fira-code-symbols
graphviz
];
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
# env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_BIN_HOME = "$HOME/.local/bin";
XDG_DATA_HOME = "$HOME/.local/share";
PATH = [
"$HOME/.config/emacs/bin"
];
};
home-manager.users.marc.xdg.configFile."doom".source = ../../../config/doom;
system.userActivationScripts = {
installDoomEmacs = ''
EMACS_FOLDER="$HOME/.config/emacs"
echo $XDG_CONFIG_HOME
echo $EMACS_FOLDER
if [ ! -d "$EMACS_FOLDER" ]; then
${pkgs.git}/bin/git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "$EMACS_FOLDER"
fi
'';
};
};
}

View File

@@ -12,7 +12,7 @@
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
options = "--delete-older-than 14d";
};
};