Compare commits

...

10 Commits

3 changed files with 46 additions and 10 deletions

View File

@ -1,4 +1,4 @@
{...}: { {lib, ...}: {
# 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.
home.username = "admin-jroeger"; home.username = "admin-jroeger";
@ -12,10 +12,12 @@
hive.nix-scripts.enable = true; hive.nix-scripts.enable = true;
hive.zsh.enable = true; hive.zsh.enable = true;
hive.doom.enable = true; hive.doom.enable = true;
hive.doom.asDefaultEditor = true;
hive.doom.enableCopilot = true; hive.doom.enableCopilot = true;
hive.doom.withNixPkgs = true; hive.doom.withNixPkgs = true;
hive.doom.withShellPkgs = true; hive.doom.withShellPkgs = true;
hive.doom.withCXXPkgs = true; hive.doom.withCXXPkgs = true;
hive.doom.withPythonPkgs = true;
# This value determines the Home Manager release that your configuration is # This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release # compatible with. This helps avoid breakage when a new Home Manager release
@ -27,7 +29,7 @@
home.stateVersion = "24.11"; # Please read the comment before changing. home.stateVersion = "24.11"; # Please read the comment before changing.
home.sessionVariables = { home.sessionVariables = {
EDITOR = "vim"; EDITOR = lib.mkDefault "vim";
}; };
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.

View File

@ -25,6 +25,7 @@
gnutls gnutls
ispell ispell
libtool libtool
vscode-langservers-extracted
]; ];
default-shell-pkgs = with pkgs; [ default-shell-pkgs = with pkgs; [
emmet-ls emmet-ls
@ -48,6 +49,11 @@
gdb gdb
ninja ninja
]; ];
default-python-pkgs = with pkgs; [
python
pythonPackages.black
pyright
];
doom-path-pkgs = doom-path-pkgs =
lib.optionals cfg.withLatexPkgs (cfg.overrideLatexPkgs default-latex-pkgs) lib.optionals cfg.withLatexPkgs (cfg.overrideLatexPkgs default-latex-pkgs)
++ lib.optionals cfg.withShellPkgs (cfg.overrideShellPkgs default-shell-pkgs) ++ lib.optionals cfg.withShellPkgs (cfg.overrideShellPkgs default-shell-pkgs)
@ -84,15 +90,25 @@
${config.xdg.configHome}/doom-emacs/bin/doom "$@" ${config.xdg.configHome}/doom-emacs/bin/doom "$@"
fi fi
''; '';
doom-open = pkgs.writeShellScriptBin "doom-open" ''
export EMACS_SOCKET_NAME="$XDG_RUNTIME_DIR/emacs/${doom-socket-name}"
if [ -t 0 ]; then
exec ${wrapped-emacs}/bin/emacsclient -t "$@"
else
exec ${wrapped-emacs}/bin/emacsclient -c "$@"
fi
'';
in { in {
options.hive.doom = { options.hive.doom = {
enable = lib.mkEnableOption "Enable Doom Emacs"; enable = lib.mkEnableOption "Enable Doom Emacs";
asDefaultEditor = lib.mkEnableOption "set the EDITOR variable to use the current emacs server (graphical/non-graphical)";
enableCopilot = lib.mkEnableOption "Enable Copilot in Doom Emacs"; enableCopilot = lib.mkEnableOption "Enable Copilot in Doom Emacs";
enableTidal = lib.mkEnableOption "Enable TidalCycles"; enableTidal = lib.mkEnableOption "Enable TidalCycles";
withLatexPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path"; withLatexPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
withShellPkgs = lib.mkEnableOption "Enable shell packages in doom path"; withShellPkgs = lib.mkEnableOption "Enable shell packages in doom path";
withNixPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path"; withNixPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
withCXXPkgs = lib.mkEnableOption "Enable CXX packages in doom path"; withCXXPkgs = lib.mkEnableOption "Enable CXX packages in doom path";
withPythonPkgs = lib.mkEnableOption "Enable python packages in doom path";
overrideLatexPkgs = lib.mkOption { overrideLatexPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package); type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs; default = pkgs: pkgs;
@ -133,6 +149,16 @@ in {
''; '';
description = "Override the default C++ packages in the doom path."; description = "Override the default C++ packages in the doom path.";
}; };
overridePythonPkgs = lib.mkOption {
type = lib.types.functionTo (lib.types.listOf lib.types.package);
default = pkgs: pkgs;
example = ''
prev: with pkgs; [
pythonPackages.black
]
'';
description = "Override the default Python packages in the doom path.";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -145,10 +171,15 @@ in {
home = { home = {
sessionPath = ["${config.xdg.configHome}/doom-emacs/bin"]; sessionPath = ["${config.xdg.configHome}/doom-emacs/bin"];
sessionVariables = { sessionVariables =
DOOMDIR = "${config.xdg.configHome}/doom-config"; {
DOOMLOCALDIR = "${config.xdg.configHome}/doom-local"; DOOMDIR = "${config.xdg.configHome}/doom-config";
}; DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
}
// lib.optionalAttrs cfg.asDefaultEditor {
EDITOR = "${doom-open.name}";
};
packages = doom-pkgs ++ lib.optional cfg.asDefaultEditor doom-open;
}; };
systemd.user.services.doom-emacs-server = { systemd.user.services.doom-emacs-server = {
@ -244,6 +275,5 @@ in {
}; };
}; };
}; };
home.packages = doom-pkgs;
}; };
} }

View File

@ -13,7 +13,11 @@ in {
default = "qt"; default = "qt";
description = "The pinentry flavour to use"; description = "The pinentry flavour to use";
}; };
withCCID = mkEnableOption "Use stand-aline CCID (instead of a running pcscd service)"; withCCID = mkOption {
type = types.bool;
default = true;
description = "Use stand-alone CCID (instead of a running pcscd service)";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -27,8 +31,8 @@ in {
trust = "ultimate"; trust = "ultimate";
} }
]; ];
scdaemonSettings = { scdaemonSettings = lib.mkIf (!cfg.withCCID) {
disable-ccid = !cfg.withCCID; disable-ccid = true;
}; };
}; };
services.gpg-agent = { services.gpg-agent = {