nix-git/modules/zsh.nix

47 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-09-02 15:33:36 +02:00
{ config, pkgs, ... }:
2023-11-23 11:09:32 +01:00
let
zsh-config = {
enable = true;
shellAliases = {
#ll = "ls -l";
#update = "sudo nixos-rebuild switch";
};
history.size = 1000;
history.ignoreDups = true;
#history.ignoreAllDups = true;
oh-my-zsh = {
enable = true;
plugins = [
# Provides many aliases and a few useful functions.
#"git"
# Easily prefix your current or previous commands with sudo by pressing `esc` twice.
#"sudo"
];
#theme = "robbyrussell";
theme = "agnoster";
};
};
in
2023-09-02 15:33:36 +02:00
{
2023-09-06 14:02:19 +02:00
# https://nixos.wiki/wiki/Command_Shell
# https://nixos.wiki/wiki/Zsh
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
2023-09-05 17:56:38 +02:00
# Inside the following Home Manager configuration block,
# `config` refers to Home Manager configuration.
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
2023-11-23 11:09:32 +01:00
programs.zsh = zsh-config // {
2023-09-05 17:56:38 +02:00
# nix-repl: config.home-manager.users.yoda.programs.zsh.history.path
2023-11-23 11:09:32 +01:00
# -> ~/.local/share/.histfile
history.path = "${config.xdg.dataHome}/.histfile";
};
};
home-manager.users.root = { osConfig, config, pkgs, ... }: {
programs.zsh = zsh-config // {
2023-09-05 17:56:38 +02:00
history.path = "${config.xdg.dataHome}/.histfile";
2023-09-02 15:33:36 +02:00
};
};
}