32 lines
819 B
Nix
32 lines
819 B
Nix
{
|
|
username ? throw "username argument is required",
|
|
}:
|
|
{ config, ... }:
|
|
let
|
|
userConfig = config.users.users.${username};
|
|
hmConfig = config.home-manager.users.${username};
|
|
in
|
|
{
|
|
environment.sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
|
|
|
|
home-manager.users.${username} = {
|
|
programs.zsh = {
|
|
enable = true;
|
|
dotDir = "${hmConfig.xdg.relativeConfigHome}/zsh";
|
|
autocd = true;
|
|
history = {
|
|
path = "${hmConfig.xdg.dataHome}/zsh/history";
|
|
expireDuplicatesFirst = true;
|
|
};
|
|
historySubstringSearch.enable = true;
|
|
autosuggestion.enable = true;
|
|
syntaxHighlighting.enable = true;
|
|
};
|
|
|
|
home = {
|
|
file.".zshenv".enable = false;
|
|
persistence."/persist${userConfig.home}".directories = [ "${hmConfig.xdg.relativeDataHome}/zsh" ];
|
|
};
|
|
};
|
|
}
|