dotfiles/modules/programs/zsh.nix

37 lines
853 B
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.zsh;
shellConfig = config.my.shell;
in
{
2022-10-15 20:00:09 +02:00
options.my.programs.zsh.enable = mkEnableOption "zsh";
2022-07-15 13:11:54 +02:00
config = lib.mkIf cfg.enable {
environment.pathsToLink = [ "/share/zsh" ];
users.users.moritz.shell = pkgs.zsh;
home-manager.users.moritz.programs = {
zsh = {
enable = true;
dotDir = ".config/zsh";
history.expireDuplicatesFirst = true;
localVariables = shellConfig.variables;
shellAliases = lib.trivial.mergeAttrs shellConfig.aliases shellConfig.abbreviations;
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
enableCompletion = true;
initExtra = ''
function nix-which() {
readlink -f $(which $1)
}
'';
};
};
};
}