zsh for root user

This commit is contained in:
Daniel Langbein 2023-11-23 11:09:32 +01:00
parent 4cf48373fd
commit a2c7be1bd3
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -1,4 +1,28 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
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
{ {
# https://nixos.wiki/wiki/Command_Shell # https://nixos.wiki/wiki/Command_Shell
# https://nixos.wiki/wiki/Zsh # https://nixos.wiki/wiki/Zsh
@ -8,31 +32,15 @@
# Inside the following Home Manager configuration block, # Inside the following Home Manager configuration block,
# `config` refers to Home Manager configuration. # `config` refers to Home Manager configuration.
home-manager.users.yoda = { osConfig, config, pkgs, ... }: { home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
programs.zsh = { programs.zsh = zsh-config // {
enable = true;
shellAliases = {
#ll = "ls -l";
#update = "sudo nixos-rebuild switch";
};
history.size = 1000;
history.ignoreDups = true;
#history.ignoreAllDups = true;
# nix-repl: config.home-manager.users.yoda.programs.zsh.history.path # nix-repl: config.home-manager.users.yoda.programs.zsh.history.path
# -> /home/yoda/.local/share/.histfile # -> ~/.local/share/.histfile
history.path = "${config.xdg.dataHome}/.histfile";
};
};
home-manager.users.root = { osConfig, config, pkgs, ... }: {
programs.zsh = zsh-config // {
history.path = "${config.xdg.dataHome}/.histfile"; history.path = "${config.xdg.dataHome}/.histfile";
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";
};
}; };
}; };
} }