split home-manager into their own submodules

This commit is contained in:
Danilo Reyes
2026-03-16 15:49:43 -06:00
parent 14eed4f7f6
commit 28c8db6cb7
43 changed files with 1011 additions and 626 deletions

View File

@@ -0,0 +1,127 @@
{
config,
lib,
pkgs,
inputs,
osConfig ? null,
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
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";
};
})
];
}