split zsh config into several nix files
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
./userservices.nix
|
||||
./starship.nix
|
||||
./userpkgs.nix
|
||||
./zshell.nix
|
||||
./zsh
|
||||
./swaync.nix
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
|
||||
36
modules/home/environment/zsh/aliases.nix
Normal file
36
modules/home/environment/zsh/aliases.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home/environment/zsh/default.nix
Normal file
10
modules/home/environment/zsh/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ lib, config, self, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./env.nix
|
||||
./aliases.nix
|
||||
./options.nix
|
||||
./extraconfig.nix
|
||||
];
|
||||
}
|
||||
22
modules/home/environment/zsh/env.nix
Normal file
22
modules/home/environment/zsh/env.nix
Normal 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/";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
74
modules/home/environment/zshell.nix → modules/home/environment/zsh/extraconfig.nix
Executable file → Normal file
74
modules/home/environment/zshell.nix → modules/home/environment/zsh/extraconfig.nix
Executable file → Normal 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
|
||||
30
modules/home/environment/zsh/options.nix
Normal file
30
modules/home/environment/zsh/options.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user