feat(shell): better shell options, move tmux to shell
This commit is contained in:
parent
f13a0f6863
commit
56cd6332ae
@ -12,7 +12,6 @@
|
||||
./shell
|
||||
./ssh.nix
|
||||
./tealdeer.nix
|
||||
./tmux.nix
|
||||
./vcs
|
||||
];
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
inherit (cfg) bashrcExtra;
|
||||
shellAliases = cfg.aliases;
|
||||
shellOptions = [
|
||||
"histappend"
|
||||
|
@ -67,24 +67,26 @@ in {
|
||||
./bash.nix
|
||||
./fish.nix
|
||||
./starship.nix
|
||||
./tmux.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
options.modules.shell = {
|
||||
tmux.enable = mkEnableOption "Enables tmux";
|
||||
enableBash = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "enables bash";
|
||||
description = "Enables bash";
|
||||
};
|
||||
enableFish = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "enables fish";
|
||||
description = "Enables fish";
|
||||
};
|
||||
enableZsh = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "enables zsh";
|
||||
description = "Enables zsh";
|
||||
};
|
||||
starship = {
|
||||
enable = mkEnableOption "Enables the starship prompt.";
|
||||
@ -124,6 +126,7 @@ in {
|
||||
enable = mkDefault cfg.enableZsh;
|
||||
abbrs = mkDefault aliases;
|
||||
};
|
||||
tmux.enable = cfg.tmux.enable;
|
||||
inherit (cfg) starship;
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,10 @@ in {
|
||||
lns = "ln -si";
|
||||
};
|
||||
};
|
||||
extraShellInit = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@ -24,11 +28,15 @@ in {
|
||||
enable = true;
|
||||
shellAbbrs = cfg.abbrs;
|
||||
preferAbbrs = true;
|
||||
shellInit = ''
|
||||
function fish_command_not_found
|
||||
__fish_default_command_not_found_handler $argv
|
||||
end
|
||||
'';
|
||||
shellInit = with lib;
|
||||
concatLines [
|
||||
''
|
||||
function fish_command_not_found
|
||||
__fish_default_command_not_found_handler $argv
|
||||
end
|
||||
''
|
||||
cfg.extraShellInit
|
||||
];
|
||||
plugins = [
|
||||
{
|
||||
name = "bass";
|
||||
|
@ -1,6 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.modules.tmux;
|
||||
in {
|
||||
options.modules.tmux.enable = mkEnableOption "Enable tmux";
|
||||
config.programs.tmux = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
customPaneNavigationAndResize = true;
|
@ -8,7 +8,7 @@ with lib; let
|
||||
cfg = config.modules.zsh;
|
||||
in {
|
||||
options.modules.zsh = {
|
||||
enable = lib.mkEnableOption "enables zsh";
|
||||
enable = lib.mkEnableOption "Enables zsh";
|
||||
abbrs = lib.mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
@ -19,17 +19,7 @@ in {
|
||||
};
|
||||
zshrcExtra = lib.mkOption {
|
||||
type = types.lines;
|
||||
default = ''
|
||||
bindkey -e
|
||||
bindkey '^p' history-search-backward
|
||||
bindkey '^n' history-search-forward
|
||||
|
||||
# Completion styling
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
|
||||
'';
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
@ -50,7 +40,21 @@ in {
|
||||
saveNoDups = true;
|
||||
};
|
||||
historySubstringSearch.enable = true;
|
||||
initContent = cfg.zshrcExtra;
|
||||
initContent = with lib;
|
||||
concatLines [
|
||||
''
|
||||
bindkey -e
|
||||
bindkey '^p' history-search-backward
|
||||
bindkey '^n' history-search-forward
|
||||
|
||||
# Completion styling
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
|
||||
''
|
||||
cfg.zshrcExtra
|
||||
];
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
|
@ -51,7 +51,10 @@ in {
|
||||
};
|
||||
|
||||
modules = {
|
||||
shell.starship.enable = true;
|
||||
shell = {
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
};
|
||||
vcs = {
|
||||
git.enable = true;
|
||||
jj.enable = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user