diff --git a/home-manager/features/cli/aliases.nix b/home-manager/features/cli/aliases.nix new file mode 100644 index 0000000..625a2b6 --- /dev/null +++ b/home-manager/features/cli/aliases.nix @@ -0,0 +1,40 @@ +{ + myAliases = { + ".." = "cd .."; + "cd.." = "cd .."; + + ls = "command eza"; + grep = "grep --color=auto"; + fgrep = "fgrep --color=auto"; + egrep = "egrep --color=auto"; + + l="eza -G --icons"; + ll="eza -l --icons"; + lg="eza -lG"; + lall="eza -lahF --icons --git"; + lalg="eza -laGhF --icons --git"; + latree="eza -laGghHT --git --icons"; + la = "eza -la --git --icons"; + lsd = "eza -laD"; + + cls="clear"; + # df="df -ahiT --total"; + userlist="cut -d: -f1 /etc/passwd"; + free="free -mt"; + du="du -ach | sort -h"; + ps="ps auxf"; + + sudo="sudo "; + reload="exec $SHELL -l"; + + xclip = "xclip -selection c"; + + mkdir="mkdir -pv"; + psmem="ps -e -orss=,args= | sort -b -k1 -nr"; + psmem10="ps -e -orss=,args= | sort -b -k1 -nr | head -10"; + pscpu="ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr"; + pscpu10="ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10"; + + gua = "git remote | xargs -L1 git push --all"; + }; +} diff --git a/home-manager/features/cli/bash.nix b/home-manager/features/cli/bash.nix index e5d7825..d560ec2 100644 --- a/home-manager/features/cli/bash.nix +++ b/home-manager/features/cli/bash.nix @@ -1,4 +1,7 @@ -programs.bash = { - enable = true; - shellAliases = myAliases; -}; +let cli = import ./aliases.nix; in +{ + programs.bash = { + enable = true; + shellAliases = cli.myAliases; + }; +} diff --git a/home-manager/features/cli/default.nix b/home-manager/features/cli/default.nix index beac002..372402a 100644 --- a/home-manager/features/cli/default.nix +++ b/home-manager/features/cli/default.nix @@ -2,7 +2,7 @@ imports = [ ./bash.nix ./git.nix - ./zsh.nix + ./zsh ]; # home.packages = with pkgs; []; } diff --git a/home-manager/features/cli/git.nix b/home-manager/features/cli/git.nix index e37c92a..3e1eb4a 100644 --- a/home-manager/features/cli/git.nix +++ b/home-manager/features/cli/git.nix @@ -1,26 +1,28 @@ -programs.git = { - enable = true; - userName = "Michał Czyż"; - userEmail = "mike@c2yz.com"; - signing = { - key = "78D4829A477DAB25"; - signByDefault = true; - }; - extraConfig = { - push = { - default = "simple"; +{ + programs.git = { + enable = true; + userName = "Michał Czyż"; + userEmail = "mike@c2yz.com"; + signing = { + key = "78D4829A477DAB25"; + signByDefault = true; }; - rerere = { - enable = true; - }; - column = { - ui = "auto"; - }; - branch = { - sort = "-committerdate"; - }; - init = { - defaultBranch = "main"; + extraConfig = { + push = { + default = "simple"; + }; + rerere = { + enable = true; + }; + column = { + ui = "auto"; + }; + branch = { + sort = "-committerdate"; + }; + init = { + defaultBranch = "main"; + }; }; }; -}; +} diff --git a/home-manager/features/cli/zsh.nix b/home-manager/features/cli/zsh.nix deleted file mode 100644 index 575f335..0000000 --- a/home-manager/features/cli/zsh.nix +++ /dev/null @@ -1,35 +0,0 @@ -programs.zsh = { - enable = true; - enableCompletion = true; - - history.size = 10000000; - history.path = "${config.xdg.dataHome}/zsh/history"; - - shellAliases = myAliases; - - initExtra = '' - [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} - eval "$(zoxide init zsh)" - ''; - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - ]; - - zplug = { - enable = true; - plugins = [ - { name = "zsh-users/zsh-autosuggestions"; } - # { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } - ]; - }; - - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - }; - -}; diff --git a/home-manager/features/cli/zsh/default.nix b/home-manager/features/cli/zsh/default.nix new file mode 100644 index 0000000..311c085 --- /dev/null +++ b/home-manager/features/cli/zsh/default.nix @@ -0,0 +1,39 @@ +{config, pkgs, ...}: let + cli = import ../aliases.nix; +in { + programs.zsh = { + enable = true; + enableCompletion = true; + + history.size = 10000000; + history.path = "${config.xdg.dataHome}/zsh/history"; + + shellAliases = cli.myAliases; + + initExtra = '' + [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} + eval "$(zoxide init zsh)" + ''; + plugins = [ + { + name = "powerlevel10k"; + src = pkgs.zsh-powerlevel10k; + file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + } + ]; + + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + # { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + }; + + }; +} diff --git a/home-manager/p10k.zsh b/home-manager/features/cli/zsh/p10k.zsh similarity index 100% rename from home-manager/p10k.zsh rename to home-manager/features/cli/zsh/p10k.zsh diff --git a/home-manager/features/kitty.nix b/home-manager/features/kitty.nix index 3df0f47..7e05fa3 100644 --- a/home-manager/features/kitty.nix +++ b/home-manager/features/kitty.nix @@ -1,9 +1,11 @@ -programs.kitty = { - enable = true; - font = { - name = "FiraCode Nerd Font"; - size = 12; - }; +{ + programs.kitty = { + enable = true; + font = { + name = "FiraCode Nerd Font"; + size = 12; + }; - theme = "Gruvbox Dark"; -}; + theme = "Gruvbox Dark"; + }; +} diff --git a/home-manager/features/neovim.nix b/home-manager/features/neovim.nix index e26f8f6..778cc0c 100644 --- a/home-manager/features/neovim.nix +++ b/home-manager/features/neovim.nix @@ -1,10 +1,12 @@ -programs.neovim = { - enable = true; - package = pkgs.unstable.neovim-unwrapped; +{pkgs, ...}: { + programs.neovim = { + enable = true; + package = pkgs.unstable.neovim-unwrapped; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; - defaultEditor = true; -}; + defaultEditor = true; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix index 9fad36d..afbe414 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -7,46 +7,7 @@ config, pkgs, ... -}: let - myAliases = { - ".." = "cd .."; - "cd.." = "cd .."; - - ls = "command eza"; - grep = "grep --color=auto"; - fgrep = "fgrep --color=auto"; - egrep = "egrep --color=auto"; - - l="eza -G --icons"; - ll="eza -l --icons"; - lg="eza -lG"; - lall="eza -lahF --icons --git"; - lalg="eza -laGhF --icons --git"; - latree="eza -laGghHT --git --icons"; - la = "eza -la --git --icons"; - lsd = "eza -laD"; - - cls="clear"; - # df="df -ahiT --total"; - userlist="cut -d: -f1 /etc/passwd"; - free="free -mt"; - du="du -ach | sort -h"; - ps="ps auxf"; - - sudo="sudo "; - reload="exec $SHELL -l"; - - xclip = "xclip -selection c"; - - mkdir="mkdir -pv"; - psmem="ps -e -orss=,args= | sort -b -k1 -nr"; - psmem10="ps -e -orss=,args= | sort -b -k1 -nr | head -10"; - pscpu="ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr"; - pscpu10="ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10"; - - gua = "git remote | xargs -L1 git push --all"; - }; -in { +}: { # You can import other home-manager modules here imports = [ # If you want to use modules your own flake exports (from modules/home-manager): @@ -156,7 +117,7 @@ in { discord telegram-desktop libreoffice-fresh - vscodium + # vscodium vscode neovide lunarvim