Extract emacs to its own submodule

This commit is contained in:
2024-07-28 16:01:36 -07:00
parent 870ebd4dd3
commit f7b2f7b59a
4 changed files with 58 additions and 39 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "doom\\"] [submodule "doom\\"]
path = doom path = modules/applications/emacs/doom
url = ssh://git@git.johnogle.info:2222/johno/doom-config.git url = ssh://git@git.johnogle.info:2222/johno/doom-config.git

View File

@@ -1,7 +1,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with import <nixpkgs> {}; with import <nixpkgs> {};
{ {
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
@@ -39,33 +38,20 @@ with import <nixpkgs> {};
pkgs.bitwarden pkgs.bitwarden
pkgs.element-desktop pkgs.element-desktop
pkgs.emacs-all-the-icons-fonts
pkgs.fd pkgs.fd
pkgs.fluffychat pkgs.fluffychat
pkgs.fontconfig
pkgs.graphviz
pkgs.htop pkgs.htop
pkgs.jellyfin-media-player pkgs.jellyfin-media-player
pkgs.less pkgs.less
pkgs.isort
pkgs.ncdu pkgs.ncdu
pkgs.nerdfonts
pkgs.nil # nix lsp language server
pkgs.nixfmt-rfc-style
pkgs.pandoc pkgs.pandoc
pkgs.pinentry-qt pkgs.pinentry-qt
pkgs.pipenv
pkgs.poetry
pkgs.python3
#pkgs.pytest #pkgs.pytest
(pkgs.ripgrep.override {withPCRE2 = true;})
pkgs.shellcheck pkgs.shellcheck
pkgs.tmux pkgs.tmux
pkgs.vlc pkgs.vlc
]; ];
fonts.fontconfig.enable = true;
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'. # plain files is through 'home.file'.
home.file = { home.file = {
@@ -80,23 +66,8 @@ with import <nixpkgs> {};
# org.gradle.daemon.idletimeout=3600000 # org.gradle.daemon.idletimeout=3600000
# ''; # '';
".config/emacs" = {
source = fetchGit {
url = "https://github.com/doomemacs/doomemacs.git";
rev = "36e7aaa619342eff61b1daf3ac664f94d5272db7";
};
recursive = true;
};
}; };
home.activation.doomSync = lib.hm.dag.entryAfter [ "writeBoundary" ] (let
emacs = pkgs.emacs;
git = pkgs.git;
in ''
export PATH=${emacs}/bin:${git}/bin:$PATH
${config.xdg.configHome}/emacs/bin/doom sync -u -j $((`nproc`/4*3))
'');
# Home Manager can also manage your environment variables through # Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a # 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell # shell provided by Home Manager. If you don't want to manage your shell
@@ -114,12 +85,13 @@ with import <nixpkgs> {};
# /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh # /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
# #
home.sessionVariables = { home.sessionVariables = {
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
EDITOR = "emacs -nw";
}; };
home.sessionPath = [ home.sessionPath = [
"${config.xdg.configHome}/emacs/bin" ];
imports = [
./modules/applications/emacs/default.nix
]; ];
programs.bash.enable = true; programs.bash.enable = true;
@@ -135,11 +107,6 @@ with import <nixpkgs> {};
programs.command-not-found.enable = true; programs.command-not-found.enable = true;
programs.emacs = {
enable = true;
package = pkgs.emacs;
};
programs.firefox = { programs.firefox = {
enable = true; enable = true;
}; };
@@ -221,6 +188,5 @@ with import <nixpkgs> {};
xdg = { xdg = {
enable = true; enable = true;
configFile."doom".source = ./doom;
}; };
} }

View File

@@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
{
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";
rev = "36e7aaa619342eff61b1daf3ac664f94d5272db7";
};
recursive = true;
};
};
home.activation.doomSync = lib.hm.dag.entryAfter [ "writeBoundary" ] (let
emacs = pkgs.emacs;
git = pkgs.git;
in ''
export PATH=${emacs}/bin:${git}/bin:$PATH
${config.xdg.configHome}/emacs/bin/doom sync -u -j $((`nproc`/4*3))
'');
home.sessionVariables = {
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
EDITOR = "emacs -nw";
};
home.sessionPath = [
"${config.xdg.configHome}/emacs/bin"
];
programs.emacs = {
enable = true;
package = pkgs.emacs;
};
xdg.configFile."doom".source = ./doom;
}