split zsh config into several nix files

This commit is contained in:
2024-11-15 09:58:31 -05:00
parent 5cd144ef33
commit 6d9e054a7a
9 changed files with 111 additions and 111 deletions

View File

@@ -6,7 +6,7 @@
./userservices.nix
./starship.nix
./userpkgs.nix
./zshell.nix
./zsh
./swaync.nix
./hyprland.nix
./waybar.nix

View File

@@ -0,0 +1,36 @@
{ lib, config, self, ... }:
{
options.movOpts.envConfig.zshConfig.shellAliases.enable = lib.mkEnableOption "enables my zsh aliases";
config = lib.mkIf config.movOpts.envConfig.zshConfig.shellAliases.enable {
programs.zsh = {
shellAliases = {
grep = "grep --color=auto";
yazi = "y";
vi = "nvim";
mv = "mv -v";
cp = "cp -vr";
gt = "gtrash";
gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put";
sr = "source ~/.zshrc";
".." = "cd ..";
rm = "echo 'use \"gtp\" instead'";
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
mkdir = "mkdir -p";
pk = "pkill -9 -f";
svcu = "systemctl --user";
svc = "sudo systemctl";
viflake = "nvim flake.nix";
iv = "invoke";
cfgfilecount =
''find $FLAKEPATH -name "*.nix" | wc -l | toilet -f 3d | lolcat'';
#git
ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
gcomm = "gitcommit_sfx";
gpush = "gitpush_sfx";
gpull = "gitpull_sfx";
greb = "gitrebase_sfx";
};
};
};
}

View File

@@ -0,0 +1,10 @@
{ lib, config, self, ... }:
{
imports = [
./env.nix
./aliases.nix
./options.nix
./extraconfig.nix
];
}

View File

@@ -0,0 +1,22 @@
{ lib, config, ... }:
{
options = {
movOpts.envConfig.zshConfig.envVariables.enable = lib.mkEnableOption "enables my default session variables";
};
config = lib.mkIf config.movOpts.envConfig.zshConfig.envVariables.enable {
programs.zsh = {
sessionVariables = {
SOUNDS_ENABLED = "1";
EDITOR = "nvim";
SUDO_EDITOR = "nvim";
VISUAL = "nvim";
LANG = "en_US.UTF-8";
BROWSER = "firefox";
FLAKEPATH = "$HOME/.sysflake";
STEAMPATH = "$HOME/.local/share/Steam";
PATH = "$PATH:$HOME/.userpath/";
};
};
};
}

View File

@@ -1,75 +1,11 @@
{ lib, config, self, ... }: {
{ lib, config, self, ... }:
{
options = {
movOpts.envConfig.zshConfig.enable =
lib.mkEnableOption "enables my zsh configuration";
movOpts.envConfig.zshConfig.extraConfig.enable = lib.mkEnableOption "enables my extra shell configurations";
};
config = lib.mkIf config.movOpts.envConfig.zshConfig.enable {
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
config = lib.mkIf config.movOpts.envConfig.zshConfig.extraConfig.enable {
programs.zsh = {
enable = true;
shellAliases = {
grep = "grep --color=auto";
yazi = "y";
vi = "nvim";
mv = "mv -v";
cp = "cp -vr";
gt = "gtrash";
gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put";
sr = "source ~/.zshrc";
".." = "cd ..";
rm = "echo 'use \"gtp\" instead'";
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
mkdir = "mkdir -p";
pk = "pkill -9 -f";
svcu = "systemctl --user";
svc = "sudo systemctl";
viflake = "nvim flake.nix";
iv = "invoke";
cfgfilecount =
''find $FLAKEPATH -name "*.nix" | wc -l | toilet -f 3d | lolcat'';
#git
"ga" = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
gcomm = "gitcommit_sfx";
gpush = "gitpush_sfx";
gpull = "gitpull_sfx";
greb = "gitrebase_sfx";
};
sessionVariables = {
SOUNDS_ENABLED = "1";
EDITOR = "nvim";
SUDO_EDITOR = "nvim";
VISUAL = "nvim";
LANG = "en_US.UTF-8";
BROWSER = "firefox";
FLAKEPATH = "$HOME/.sysflake";
STEAMPATH = "$HOME/.local/share/Steam";
PATH = "$PATH:$HOME/.userpath/";
};
oh-my-zsh = {
enable = true;
plugins = [ "git" "fzf" ];
};
enableCompletion = true;
history = {
path = "$HOME/.zsh_history";
save = 10000;
size = 10000;
share = true;
};
autosuggestion = {
enable = true;
highlight = "fg=#4C566A,underline";
};
initExtra = ''
playshellsound() {
if [ $# -ne 1 ]; then

View File

@@ -0,0 +1,30 @@
{ lib, config, ... }:
{
options = {
movOpts.envConfig.zshConfig.shellOptions.enable = lib.mkEnableOption "enables my default shell settings";
};
config = lib.mkIf config.movOpts.envConfig.zshConfig.shellOptions.enable {
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" "fzf" ];
};
enableCompletion = true;
history = {
path = "$HOME/.zsh_history";
save = 10000;
size = 10000;
share = true;
};
};
};
}