Home Gen494 @ 2025-04-09-12:54

This commit is contained in:
Jonas Röger 2025-04-09 12:54:45 +02:00
parent 5b22736b9f
commit 22c02c6184
2 changed files with 160 additions and 101 deletions

View File

@ -33,6 +33,10 @@
age.keyFile = "${home.homeDirectory}/.config/sops/age/keys.txt";
};
doom.enable = true;
doom.withNixPkgs = true;
doom.withShellPkgs = true;
# Make session variables available in systemd units
# SEE: https://github.com/nix-community/home-manager/pull/5543
# systemd.user.settings.Manager.DefaultEnvironment =

View File

@ -4,48 +4,53 @@
lib,
...
}: let
cfg = config.doom;
doom-pkgs = with pkgs; [
fira
fira-code-nerdfont
emacs-all-the-icons-fonts
];
doom-path-pkgs = with pkgs; [
default-core-pkgs = with pkgs; [
(ripgrep.override {withPCRE2 = true;})
alejandra
(aspellWithDicts (d: [d.en d.de d.en-computers d.en-science]))
binutils
ccls
clang-tools
cmake
editorconfig-core-c
emmet-ls
fd
gcc
gdb
git
gnumake
gnutls
graphviz
imagemagick
ispell
libtool
lldb
mermaid-filter
mlocate
];
default-shell-pkgs = with pkgs; [
emmet-ls
];
default-nix-pkgs = with pkgs; [
alejandra
nixd
nodejs_22
];
default-latex-pkgs = with pkgs; [
pandoc
pandoc-katex
poppler
python311
python311Packages.debugpy
python311Packages.grip
texlab
texlive.combined.scheme-medium
unzip
zlib
zstd
];
default-cxx-pkgs = with pkgs; [
clang
clang-format
clang-tools
cmake
cppcheck
doxygen
gdb
ninja
];
doom-path-pkgs =
lib.optionals cfg.withLatexPkgs (cfg.overrideLatexPkgs default-latex-pkgs)
++ lib.optionals cfg.withShellPkgs (cfg.overrideShellPkgs default-shell-pkgs)
++ lib.optionals cfg.withNixPkgs (cfg.overrideNixPkgs default-nix-pkgs)
++ lib.optionals cfg.withCXXPkgs (cfg.overrideCXXPkgs default-cxx-pkgs)
++ default-core-pkgs;
doom-socket-name = "main";
wrapped-emacs = pkgs.symlinkJoin {
name = "wrapped-emacs";
@ -76,6 +81,55 @@
fi
'';
in {
options.doom = {
enable = lib.mkEnableOption "Enable Doom Emacs";
withLatexPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
withShellPkgs = lib.mkEnableOption "Enable shell packages in doom path";
withNixPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
withCXXPkgs = lib.mkEnableOption "Enable CXX packages in doom path";
overrideLatexPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs;
example = ''
prev: with pkgs; [
texlive.combined.scheme-full
]
'';
description = "Override the default LaTeX packages in the doom path.";
};
overrideShellPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs;
example = ''
prev: with pkgs; [
shellcheck
]
'';
description = "Override the default shell packages in the doom path.";
};
overrideNixPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs;
example = ''
prev: with pkgs; [
nixpkgs-fmt
]
'';
description = "Override the default Nix packages in the doom path.";
};
overrideCXXPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs;
example = ''
prev: with pkgs; [
openmp
]
'';
description = "Override the default C++ packages in the doom path.";
};
};
config = lib.mkIf cfg.enable {
programs.emacs = {
enable = true;
package = wrapped-emacs;
@ -169,4 +223,5 @@ in {
};
};
home.packages = doom-pkgs;
};
}