diff --git a/.gitignore b/.gitignore index 49400f4..cc70e20 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -env.nix result hardware.nix diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 63a7aea..0790fb2 100755 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.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 diff --git a/modules/home/environment/default.nix b/modules/home/environment/default.nix index e2ca79d..74a692e 100755 --- a/modules/home/environment/default.nix +++ b/modules/home/environment/default.nix @@ -6,7 +6,7 @@ ./userservices.nix ./starship.nix ./userpkgs.nix - ./zshell.nix + ./zsh ./swaync.nix ./hyprland.nix ./waybar.nix diff --git a/modules/home/environment/zsh/aliases.nix b/modules/home/environment/zsh/aliases.nix new file mode 100644 index 0000000..0ad8c9f --- /dev/null +++ b/modules/home/environment/zsh/aliases.nix @@ -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"; + }; + }; + }; +} diff --git a/modules/home/environment/zsh/default.nix b/modules/home/environment/zsh/default.nix new file mode 100644 index 0000000..4333d66 --- /dev/null +++ b/modules/home/environment/zsh/default.nix @@ -0,0 +1,10 @@ +{ lib, config, self, ... }: + +{ + imports = [ + ./env.nix + ./aliases.nix + ./options.nix + ./extraconfig.nix + ]; +} diff --git a/modules/home/environment/zsh/env.nix b/modules/home/environment/zsh/env.nix new file mode 100644 index 0000000..6925825 --- /dev/null +++ b/modules/home/environment/zsh/env.nix @@ -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/"; + }; + }; + }; +} diff --git a/modules/home/environment/zshell.nix b/modules/home/environment/zsh/extraconfig.nix old mode 100755 new mode 100644 similarity index 71% rename from modules/home/environment/zshell.nix rename to modules/home/environment/zsh/extraconfig.nix index e553d67..7583516 --- a/modules/home/environment/zshell.nix +++ b/modules/home/environment/zsh/extraconfig.nix @@ -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 diff --git a/modules/home/environment/zsh/options.nix b/modules/home/environment/zsh/options.nix new file mode 100644 index 0000000..5f1c801 --- /dev/null +++ b/modules/home/environment/zsh/options.nix @@ -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; + }; + }; + }; +} diff --git a/overlay/tinyfetch/package.nix b/overlay/tinyfetch/package.nix deleted file mode 100644 index 308823a..0000000 --- a/overlay/tinyfetch/package.nix +++ /dev/null @@ -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; - }; -}