128 lines
3.3 KiB
Nix
128 lines
3.3 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
inputs,
|
|
osConfig ? null,
|
|
...
|
|
}:
|
|
let
|
|
shellType = inputs.self.lib.hmShellType osConfig "zsh";
|
|
hm = inputs.self.lib.hmModule {
|
|
inherit
|
|
config
|
|
inputs
|
|
osConfig
|
|
;
|
|
optionPath = [
|
|
"shell"
|
|
"tools"
|
|
];
|
|
};
|
|
cfg = config.my.shell.tools;
|
|
in
|
|
{
|
|
options.my.shell.tools.enable = lib.mkEnableOption "shell tools and utilities";
|
|
config = lib.mkMerge [
|
|
{
|
|
my.shell.tools.enable = lib.mkDefault hm.enabledByDefault;
|
|
}
|
|
(lib.mkIf cfg.enable {
|
|
home.packages = builtins.attrValues {
|
|
inherit (pkgs)
|
|
ripgrep
|
|
dust
|
|
fd
|
|
fzf
|
|
gdu
|
|
tealdeer
|
|
trash-cli
|
|
jq
|
|
yq
|
|
smartmontools
|
|
rmlint
|
|
;
|
|
};
|
|
programs = {
|
|
hstr.enable = true;
|
|
htop = {
|
|
enable = true;
|
|
package = pkgs.htop-vim;
|
|
};
|
|
eza = {
|
|
enable = true;
|
|
git = true;
|
|
icons = "auto";
|
|
};
|
|
zoxide = {
|
|
enable = true;
|
|
enableBashIntegration = shellType == "bash";
|
|
enableZshIntegration = shellType == "zsh";
|
|
};
|
|
bat = {
|
|
enable = true;
|
|
config.pager = "less -FR";
|
|
extraPackages = builtins.attrValues {
|
|
inherit (pkgs.bat-extras)
|
|
batman
|
|
batpipe
|
|
batgrep
|
|
batdiff
|
|
batwatch
|
|
prettybat
|
|
;
|
|
};
|
|
};
|
|
password-store = {
|
|
enable = false;
|
|
package = pkgs.gopass;
|
|
settings = {
|
|
PASSWORD_STORE_AUTOCLIP = "true";
|
|
PASSWORD_STORE_AUTOIMPORT = "false";
|
|
PASSWORD_STORE_CLIPTIMEOUT = "45";
|
|
PASSWORD_STORE_EXPORTKEYS = "false";
|
|
PASSWORD_STORE_NOPAGER = "false";
|
|
PASSWORD_STORE_NOTIFICATIONS = "false";
|
|
PASSWORD_STORE_PARSING = "true";
|
|
PASSWORD_STORE_PATH = "${config.home.homeDirectory}/.local/share/pass";
|
|
PASSWORD_STORE_SAFECONTENT = "true";
|
|
};
|
|
};
|
|
${shellType} = {
|
|
shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
|
cd = "z";
|
|
hh = "hstr";
|
|
ls = "eza --icons --group-directories-first";
|
|
rm = "trash";
|
|
b = "bat";
|
|
f = "fzf --multi --exact -i";
|
|
unique-extensions = ''
|
|
fd -tf | rev | cut -d. -f1 | rev |
|
|
tr '[:upper:]' '[:lower:]' | sort |
|
|
uniq --count | sort -rn'';
|
|
};
|
|
}
|
|
//
|
|
inputs.self.lib.shellConditional shellType
|
|
''
|
|
if command -v fzf-share >/dev/null; then
|
|
source "$(fzf-share)/key-bindings.bash"
|
|
source "$(fzf-share)/completion.bash"
|
|
fi
|
|
''
|
|
''
|
|
if command -v fzf-share >/dev/null; then
|
|
source "$(fzf-share)/key-bindings.bash"
|
|
source "$(fzf-share)/completion.bash"
|
|
fi
|
|
'';
|
|
};
|
|
home.sessionVariables = {
|
|
HISTFILE = "\${XDG_STATE_HOME}/bash/history";
|
|
LESSHISTFILE = "-";
|
|
RIPGREP_CONFIG_PATH = "\${XDG_CONFIG_HOME}/ripgrep/ripgreprc";
|
|
};
|
|
})
|
|
];
|
|
}
|