feat: make zsh startup more performant

This commit is contained in:
Leon Schwarzäugl 2025-06-11 02:31:01 +02:00
parent 6b33a182d8
commit f431d24f81
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
4 changed files with 126 additions and 132 deletions

View file

@ -5778,14 +5778,17 @@ Some programs profit from being installed through dedicated NixOS settings on sy
:PROPERTIES:
:CUSTOM_ID: h:7daa06ff-d3b0-4491-97ce-770b749c52f9
:END:
Do not touch this.
Here I disable global completion to prevent redundant compinit calls and cache invalidation that slow down shell startup (enabled on the home-manager side).
#+begin_src nix :tangle modules/nixos/common/zsh.nix
{ lib, config, pkgs, ... }:
{
options.swarselsystems.modules.zsh = lib.mkEnableOption "zsh base config";
config = lib.mkIf config.swarselsystems.modules.zsh {
programs.zsh.enable = true;
programs.zsh = {
enable = true;
enableCompletion = false;
};
users.defaultUserShell = pkgs.zsh;
environment.shells = with pkgs; [ zsh ];
environment.pathsToLink = [ "/share/zsh" ];