dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
modules/shell/shell-utils.nix (3027B)
1## Shell Utilities ##
2{config, ...}: let
3 inherit (config.flake) files;
4in {
5 flake.modules = {
6 nixos.shell-utils = {pkgs, ...}: {
7 config = {
8 environment = {
9 # Utilities
10 systemPackages = with pkgs; [
11 btop
12 fastfetch
13 fd
14 hstr
15 lolcat
16 tree
17 yazi
18 zellij
19 ];
20
21 # Fetch
22 etc."fastfetch/config.jsonc".text = files.fetch;
23
24 # Command Aliases
25 shellAliases = {
26 hi = "echo 'Hi there. How are you?'";
27 bye = "exit";
28 c = "bat";
29 l = "eza -b -h -l -F --octal-permissions --time-style iso";
30 grep = "grep --color";
31 colors = "${files.scripts.colors}";
32 sike = "fastfetch";
33 };
34 };
35
36 ## Program Configuration
37 services.lorri.enable = true;
38 programs = {
39 # Command Correction Helper
40 pay-respects = {
41 enable = true;
42 alias = "fix";
43 };
44
45 # DirENV Support
46 direnv = {
47 enable = true;
48 nix-direnv.enable = true;
49 };
50 };
51 };
52 };
53
54 homeManager.shell-utils = _: {
55 home.persist = {
56 files = [".hstr_favorites"];
57 directories = [
58 ".local/share/direnv"
59 ".local/share/zoxide"
60 ];
61 };
62
63 programs = {
64 btop.enable = true; # Resource Monitor
65 zellij.enable = true; # Terminal Multiplexer
66
67 # Text Search
68 ripgrep = {
69 enable = true;
70 arguments = [
71 "--smart-case"
72 "--hidden"
73 "--heading"
74 "--line-number"
75 "--column"
76 "--color=auto"
77 "--max-columns=150"
78 "--max-columns-preview"
79 "--colors=line:style:bold"
80 "--colors=path:fg:cyan"
81 "--colors=path:style:bold"
82 "--colors=match:fg:magenta"
83 "--colors=match:style:bold"
84 ];
85 };
86
87 # Command History Manager
88 hstr = {
89 enable = true;
90 enableBashIntegration = true;
91 enableZshIntegration = true;
92 };
93
94 # File Manager
95 yazi = {
96 enable = true;
97 enableBashIntegration = true;
98 enableZshIntegration = true;
99 };
100
101 # Smarter cd
102 zoxide = {
103 enable = true;
104 enableBashIntegration = true;
105 enableZshIntegration = true;
106 };
107
108 # Pager
109 bat = {
110 enable = true;
111 config = {
112 style = "full";
113 italic-text = "always";
114 };
115 };
116
117 # File Lister
118 eza = {
119 enable = true;
120 enableBashIntegration = true;
121 enableZshIntegration = true;
122 colors = "auto";
123 icons = "auto";
124 git = true;
125 extraOptions = ["--group-directories-first"];
126 };
127 };
128 };
129 };
130}