aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shell
diff options
context:
space:
mode:
Diffstat (limited to 'modules/shell')
-rw-r--r--modules/shell/bash/default.nix13
-rw-r--r--modules/shell/default.nix8
-rw-r--r--modules/shell/zsh/default.nix15
-rw-r--r--modules/shell/zsh/zshrc19
4 files changed, 55 insertions, 0 deletions
diff --git a/modules/shell/bash/default.nix b/modules/shell/bash/default.nix
new file mode 100644
index 0000000..f26e3d8
--- /dev/null
+++ b/modules/shell/bash/default.nix
@@ -0,0 +1,13 @@
+{ config, lib, ... }:
+
+{
+ options = {
+ bash.enable = lib.mkEnableOption "Enables bash.";
+ };
+
+ config = lib.mkIf config.bash.enable {
+ programs.bash.enable = true;
+ programs.bash.historyFile = "${config.xdg.cacheHome}/bash/history";
+ home.file."${config.xdg.cacheHome}/bash/histroy".text = ""; # Create the cache directory and histroy file
+ };
+}
diff --git a/modules/shell/default.nix b/modules/shell/default.nix
new file mode 100644
index 0000000..e4c3964
--- /dev/null
+++ b/modules/shell/default.nix
@@ -0,0 +1,8 @@
+{ lib, config, ... }:
+
+{
+ imports = [
+ ./bash
+ ./zsh
+ ];
+}
diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix
new file mode 100644
index 0000000..b4ea77a
--- /dev/null
+++ b/modules/shell/zsh/default.nix
@@ -0,0 +1,15 @@
+{ config, lib, ... }:
+
+{
+ options = {
+ zsh.enable = lib.mkEnableOption "Enables zsh.";
+ };
+
+ config = lib.mkIf config.zsh.enable {
+ programs.zsh.enable = true;
+ programs.zsh.dotDir = ".config/zsh";
+ programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history";
+ programs.zsh.initExtra = builtins.readFile ./zshrc;
+ programs.zsh.shellAliases = config.programs.bash.shellAliases;
+ };
+}
diff --git a/modules/shell/zsh/zshrc b/modules/shell/zsh/zshrc
new file mode 100644
index 0000000..528bf68
--- /dev/null
+++ b/modules/shell/zsh/zshrc
@@ -0,0 +1,19 @@
+setopt PROMPT_SUBST
+
+autoload -U colors && colors
+
+autoload -Uz vcs_info
+precmd() { vcs_info }
+
+zstyle ':vcs_info:git:*' formats ' %F{yellow}[%F{cyan}%b %c%F{blue}%a%F{yellow}]'
+zstyle ':vcs_info:git:*' actionformats ' %F{yellow}[%F{cyan}%b %c%F{blue}%a%F{yellow}]'
+
+zstyle ':vcs_info:*+set-message:*' hooks git-untracked git-dirty
+
+zstyle ':vcs_info:git:*' check-for-changes true
+zstyle ':vcs_info:git:*' stagedstr '%F{green}✓%f'
+zstyle ':vcs_info:git:*' unstagedstr '%F{red}✗%f'
+zstyle ':vcs_info:git:*' aheadstr '%F{blue}⬆%f'
+zstyle ':vcs_info:git:*' behindstr '%F{yellow}⬇%f'
+PROMPT='%F{red}╭──[%F{green}%m%F{red}@%F{blue}%n%F{red}] %F{magenta}%~%f${vcs_info_msg_0_}%F{red}
+╰─>%f '