split zsh config into several nix files
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
env.nix
|
||||
result
|
||||
hardware.nix
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, lib, config, ... }: {
|
||||
{ username, ... }: {
|
||||
home.username = "${username}"; # Replace with your actual username
|
||||
home.homeDirectory =
|
||||
"/home/${username}"; # Replace with your actual home directory
|
||||
@@ -25,7 +25,12 @@
|
||||
spicetifyConfig.enable = true;
|
||||
starshipConfig.enable = true;
|
||||
swayncConfig.enable = true;
|
||||
zshConfig.enable = true;
|
||||
zshConfig = {
|
||||
shellAliases.enable = true;
|
||||
envVariables.enable = true;
|
||||
shellOptions.enable = true;
|
||||
extraConfig.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# modules/home/programs
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.zshConfig.enable {
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
movOpts.envConfig.zshConfig.extraConfig.enable = lib.mkEnableOption "enables my extra shell configurations";
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "tinyfetch";
|
||||
version = "0.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "abrik1";
|
||||
repo = "tinyfetch";
|
||||
rev = "refs/tags/0.2";
|
||||
hash = "sha256-nuC7Xtfg7rf6/IDhUKT2JZD9V0Hl/welNAFDJYJKwmA=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
$CC src/tinyfetch.c -o tinyfetch
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 tinyfetch -t $out/bin
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Simple fetch in C which is tiny and fast";
|
||||
homepage = "https://github.com/abrik1/tinyfetch";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "tinyfetch";
|
||||
maintainers = with lib.maintainers; [ pagedMov ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user