feat: aliases and dekstop switching

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-01-15 19:06:40 -03:00
parent 33530ac1ed
commit 56bd7b1088
7 changed files with 155 additions and 16 deletions

View File

@@ -1,30 +0,0 @@
{ config, inputs, pkgs, ... }:
{
imports = [
../programs/starship.nix
../programs/tmux.nix
../programs/wezterm.nix
../programs/zsh.nix
];
options = { };
config = {
starship.enable = true;
starship.enableZsh = true;
tmux.enable = true;
tmux.shell = "\${pkgs.zsh}/bin/zsh";
wezterm.enable = true;
wezterm.integration.zsh = true;
wezterm.defaultProg = [
"zsh"
"--login"
"-c"
"tmux"
"-f ${config.xdg.configHome}/tmux/tmux.conf"
];
zsh.enable = true;
};
}

View File

@@ -4,24 +4,61 @@ let
cfg = config.zsh;
in
{
options.zsh = {
enable = lib.mkEnableOption "Enable Zsh shell";
options.zsh = with lib; with lib.types; {
enable = mkEnableOption "Enable Zsh shell";
plugins = {
suggestions.enable = lib.mkOption {
type = lib.types.bool;
suggestions.enable = mkOption {
type = bool;
default = true;
};
completion.enable = lib.mkOption {
type = lib.types.bool;
completion.enable = mkOption {
type = bool;
default = true;
};
};
extraConfig = {
init = mkOption {
type = lines;
default = "";
};
beforeComp = mkOption {
type = lines;
default = "";
};
first = mkOption {
type = lines;
default = "";
};
};
loginExtra = mkOption {
type = lines;
default = "";
};
logoutExtra = mkOption {
type = lines;
default = "";
};
variables = mkOption {
type = attrsOf str;
default = { };
};
};
config = lib.mkIf cfg.enable {
programs.zsh.enable = true;
programs.zsh.oh-my-zsh.enable = true;
programs.zsh = {
enable = true;
oh-my-zsh.enable = true;
programs.zsh.enableAutosuggestions = lib.mkIf (cfg.plugins.suggestions.enable) true;
programs.zsh.enableCompletion = lib.mkIf (cfg.plugins.completion.enable) true;
loginExtra = cfg.loginExtra;
logoutExtra = cfg.logoutExtra;
initExtra = cfg.extraConfig.init;
initExtraBeforeCompInit = cfg.extraConfig.beforeComp;
initExtraFirst = cfg.extraConfig.first;
localVariables = cfg.variables;
enableAutosuggestions = lib.mkIf (cfg.plugins.suggestions.enable) true;
enableCompletion = lib.mkIf (cfg.plugins.completion.enable) true;
};
};
}