From 05d057eba4a9975400b3554dcb1fd8f21f8e4837 Mon Sep 17 00:00:00 2001 From: reo101 Date: Thu, 24 Nov 2022 02:16:02 +0200 Subject: [PATCH] feat(cheetah): add `zsh` Set `zsh` as default shell Integrate with `direnv` and `starship` --- nix-on-droid/cheetah/configuration.nix | 2 ++ nix-on-droid/cheetah/home.nix | 41 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/nix-on-droid/cheetah/configuration.nix b/nix-on-droid/cheetah/configuration.nix index de3c9e1..9a874c1 100644 --- a/nix-on-droid/cheetah/configuration.nix +++ b/nix-on-droid/cheetah/configuration.nix @@ -12,6 +12,8 @@ # # Set $EDITOR # environment.variables.EDITOR = "nvim"; + user.shell = "${pkgs.zsh}/bin/zsh"; + # Read the changelog before changing this value system.stateVersion = "22.05"; diff --git a/nix-on-droid/cheetah/home.nix b/nix-on-droid/cheetah/home.nix index bb6007e..f571c46 100644 --- a/nix-on-droid/cheetah/home.nix +++ b/nix-on-droid/cheetah/home.nix @@ -35,6 +35,9 @@ zip unzip + direnv + nix-direnv + # Bling onefetch neofetch @@ -90,6 +93,39 @@ ]; }; + programs.zsh = { + enable = true; + enableCompletion = true; + defaultKeymap = "viins"; + + shellAliases = { + # ll = "ls -l"; + # update = "sudo nixos-rebuild switch"; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + + initExtra = '' + eval "$(direnv hook zsh)" + ''; + + plugins = [ + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v0.5.0"; + sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91"; + }; + } + ]; + }; + programs.starship = { enable = true; @@ -297,4 +333,9 @@ defaultCacheTtl = 1800; enableSshSupport = true; }; + + # Using nix-direnv + # services.lorri = { + # enable = true; + # }; }