nixos/modules/shell/zsh/default.nix

78 lines
1.9 KiB
Nix
Raw Normal View History

2023-07-08 23:27:08 +04:00
{
2023-12-24 13:35:41 +04:00
inputs,
options,
config,
lib,
pkgs,
...
}:
2024-08-01 16:24:09 +04:00
let
2023-12-24 13:35:41 +04:00
cfg = config.modules.shell.zsh;
in {
2023-07-08 23:27:08 +04:00
options.modules.shell.zsh = {
2024-08-01 16:24:09 +04:00
enable = lib.mkEnableOption false;
2023-07-08 23:27:08 +04:00
};
2024-08-01 16:24:09 +04:00
config = lib.mkIf cfg.enable {
2023-07-08 23:27:08 +04:00
users.users.sako.shell = pkgs.zsh;
2023-12-24 13:35:41 +04:00
2023-07-08 23:27:08 +04:00
programs.zsh = {
enable = true;
2023-07-15 22:43:10 +04:00
enableCompletion = true;
2023-12-24 13:35:41 +04:00
# promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
2023-07-15 20:14:15 +04:00
};
2023-12-24 13:35:41 +04:00
home-manager.users.sako = {pkgs, ...}: {
home.file = {
};
programs.direnv = {
enableZshIntegration = true;
enable = true;
2023-07-16 21:59:45 +04:00
};
2023-12-24 13:35:41 +04:00
programs.zsh = {
enable = true;
enableCompletion = true;
shellAliases = {
ll = "ls -l";
2024-07-05 22:59:07 +04:00
# nix thing
2023-12-24 13:35:41 +04:00
update = "sudo nixos-rebuild switch -v";
2024-07-05 22:59:07 +04:00
search = "nix search";
shell = "nix shell";
run = "nix run";
cleanup = "sudo nix-collect-garbage --delete-older-than 3d && nix-collect-garbage -d";
2024-09-01 12:15:52 +04:00
current-system-tree = "nix-tree /nix/var/nix/profiles/system";
2023-07-15 22:39:22 +04:00
};
2023-12-24 13:35:41 +04:00
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.7.0";
sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
};
}
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = ../../../config/zsh;
file = "p10k.zsh";
}
];
};
2023-07-08 23:27:08 +04:00
};
# for theme
2023-12-24 13:35:41 +04:00
fonts.packages = with pkgs; [
jetbrains-mono
(nerdfonts.override {fonts = ["JetBrainsMono"];})
2023-07-08 23:27:08 +04:00
];
};
}