feat(home): move cli config to homes and use home-manager modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 19:15:48 +08:00
parent 1a3ff4b92a
commit 00e3ea65c8
No known key found for this signature in database
17 changed files with 198 additions and 271 deletions

View file

@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
let
inherit (lib) singleton;
in
{
home = {
packages = singleton pkgs.fastfetch;
sessionVariables.FETCH = "hyfetch";
shellAliases.fetch = "hyfetch";
};
programs.hyfetch = {
enable = true;
settings = {
preset = "bisexual";
mode = "rgb";
light_dark = "dark";
lightness = 0.5;
color_align = {
mode = "horizontal";
custom_colors = [ ];
fore_back = null;
};
backend = "fastfetch";
};
};
}

View file

@ -0,0 +1,20 @@
{
home.sessionVariables.FILE_BROWSER = "yazi";
programs.yazi = {
enable = true;
shellWrapperName = "t";
settings = {
mgr = {
sort_by = "natural";
};
opener = {
play = [
{
run = "vlc \"$@\"";
desc = "Open";
}
];
};
};
};
}

View file

@ -0,0 +1,6 @@
{
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
}

View file

@ -0,0 +1,54 @@
{ pkgs, osConfig, ... }:
{
home.sessionVariables.MULTIPLEXER = "zellij";
persistDirs = [ "/.cache/zellij" ];
programs.zellij = {
enable = true;
enableZshIntegration = true;
settings = {
pane_frames = false;
show_startup_tips = false;
show_release_notes = false;
};
};
xdg.configFile."zellij/layouts/default.kdl".text = # kdl
''
layout {
default_tab_template {
pane size=1 borderless=true {
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
format_left "{mode} ${osConfig.system.hostname}"
format_center "{tabs}"
format_right "{datetime}"
format_space ""
format_hide_on_overlength "true"
format_precedence "lrc"
border_enabled "false"
border_char ""
border_format "#[fg=#6C7086]{char}"
border_position "top"
hide_frame_for_single_pane "false"
mode_default_to_mode "normal"
mode_normal "#[bg=#89B4FA] {name} "
mode_locked "#[bg=#f55e18] {name} "
mode_session "#[bg=#00ff00] {name} "
tab_normal "#[fg=#6C7086] {index} "
tab_active "#[fg=#9399B2,bold,italic] {index} "
tab_display_count "3" // limit to showing 3 tabs
tab_truncate_start_format "..."
tab_truncate_end_format "..."
datetime "#[fg=#6C7086,bold] {format}"
datetime_format "%H:%M:%S"
datetime_timezone "Asia/Singapore"
}
}
children
}
}
'';
}

View file

@ -0,0 +1,42 @@
{ lib, pkgs, ... }:
let
inherit (builtins) toString;
inherit (lib) mkOrder;
screensaverTimeout = toString 100;
screensaverCommand = "${pkgs.cbonsai}/bin/cbonsai -S -w 0.1 -L 40 -M 2 -b 2";
in
{
home.shell.enableShellIntegration = true;
home.sessionVariables.SHELL = "zsh";
programs.zsh = {
enable = true;
enableVteIntegration = true;
syntaxHighlighting.enable = true;
historySubstringSearch.enable = true;
history = {
append = true;
extended = true;
ignoreDups = true;
ignoreSpace = true;
save = 10000;
share = true;
size = 10000;
};
};
programs.zsh.initContent =
mkOrder 1200
# zsh
''
precmd() {
TMOUT=${screensaverTimeout}
}
TRAPALRM() {
TMOUT=1
${screensaverCommand}
# If we exit, assume the previous command was exited out of
TMOUT=${screensaverTimeout}
zle reset-prompt
}
'';
}

View file

@ -0,0 +1,24 @@
{
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
home.shellAliases = {
gs = "git status";
gc = "git commit";
gcam = "git commit -am";
gu = "git push";
gy = "git pull";
};
programs.git = {
enable = true;
userName = "Mohammad Rafiq";
userEmail = "rafiq@rrv.sh";
signing.key = "~/.ssh/id_ed25519.pub";
signing.signByDefault = true;
extraConfig = {
init.defaultBranch = "prime";
push.autoSetupRemote = true;
pull.rebase = false;
core.editor = "$EDITOR";
gpg.format = "ssh";
};
};
}

View file

@ -0,0 +1,53 @@
{ inputs, pkgs, ... }:
{
programs = {
nh.enable = true;
tealdeer.enable = true;
tealdeer.settings.updates.auto_update = true;
pay-respects.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
starship = {
enable = true;
settings = {
add_newline = false;
format = ''
$directory$character
'';
right_format = ''
$all
'';
git_branch.format = "[$symbol$branch(:$remote_branch)]($style) ";
shlvl.disabled = false;
hostname.disabled = true;
username.disabled = true;
};
};
};
home = {
shellAliases = {
v = "nvim";
e = "edit";
cd = "z";
ai = "aichat -r %shell% -e";
};
packages = with pkgs; [
aichat
devenv
pantheon.rebuild
pantheon.deploy
pantheon.edit
pantheon.commit
pantheon.check
inputs.nixspect.packages."x86_64-linux".nixspect
];
};
xdg.configFile."aichat/config.yaml".text = ''
model: gemini:gemini-2.0-flash
clients:
- type: gemini
'';
}

View file

@ -1,5 +1,4 @@
{
pkgs,
inputs,
osConfig,
lib,
@ -26,7 +25,9 @@ let
};
in
{
imports = (optional osConfig.desktop.enable (import-tree ./desktop)) ++ singleton (import-tree ./cli);
imports =
(optional osConfig.desktop.enable (import-tree ./desktop))
++ singleton (import-tree ./cli);
config = {
accounts = {
@ -40,46 +41,5 @@ in
};
};
};
cli = {
shell = "zsh";
finder = "fzf";
screensaver.enable = true;
screensaver.timeout = "100";
screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2";
file-browser = "yazi";
multiplexer = "zellij";
fetch = "hyfetch";
git.name = "Mohammad Rafiq";
git.email = "rafiq@rrv.sh";
git.defaultBranch = "prime";
};
home = {
shellAliases = {
v = "nvim";
e = "edit";
};
packages = with pkgs; [
cbonsai
ripgrep
devenv
pantheon.rebuild
pantheon.deploy
pantheon.edit
pantheon.commit
pantheon.check
inputs.nixspect.packages."x86_64-linux".nixspect
];
};
programs = {
nh.enable = true;
tealdeer.enable = true;
tealdeer.settings.updates.auto_update = true;
pay-respects.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
};
}