Update fastfetch.nix

This commit is contained in:
ediblerope 2025-12-03 20:22:36 +00:00 committed by GitHub
parent 1f5539a804
commit fd76fc7258
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@
fastfetch fastfetch
]; ];
# Create the fastfetch config file # Create the fastfetch config file with unicode icons
environment.etc."fastfetch/config.jsonc".text = '' environment.etc."fastfetch/config.jsonc".text = ''
{ {
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
@ -18,7 +18,7 @@
} }
}, },
"display": { "display": {
"separator": " ", "separator": " ",
"color": { "color": {
"keys": "blue", "keys": "blue",
"title": "cyan" "title": "cyan"
@ -35,77 +35,77 @@
}, },
{ {
"type": "os", "type": "os",
"key": "OS", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "host", "type": "host",
"key": "Host", "key": "󰌢 ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "kernel", "type": "kernel",
"key": "Kernel", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "uptime", "type": "uptime",
"key": "Uptime", "key": "󰔟 ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "packages", "type": "packages",
"key": "Packages", "key": "󰏖 ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "shell", "type": "shell",
"key": "Shell", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "terminal", "type": "terminal",
"key": "Terminal", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "de", "type": "de",
"key": "DE", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "wm", "type": "wm",
"key": "WM", "key": " ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "wmtheme", "type": "wmtheme",
"key": "Theme", "key": "󰉼 ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "icons", "type": "icons",
"key": "Icons", "key": "󰀻 ",
"keyColor": "blue" "keyColor": "blue"
}, },
{ {
"type": "cpu", "type": "cpu",
"key": "CPU", "key": "󰻠 ",
"keyColor": "green" "keyColor": "green"
}, },
{ {
"type": "gpu", "type": "gpu",
"key": "GPU", "key": "󰍛 ",
"keyColor": "green" "keyColor": "green"
}, },
{ {
"type": "memory", "type": "memory",
"key": "Memory", "key": "󰑭 ",
"keyColor": "yellow" "keyColor": "yellow"
}, },
{ {
"type": "disk", "type": "disk",
"key": "Disk", "key": "󰋊 ",
"keyColor": "yellow" "keyColor": "yellow"
}, },
{ {
@ -121,11 +121,39 @@
} }
''; '';
# Set up bash to run fastfetch on start # Set up bash with fastfetch and a nice prompt
programs.bash.interactiveShellInit = '' programs.bash.interactiveShellInit = ''
# Run fastfetch on terminal start (but not in non-interactive shells) # Run fastfetch on terminal start (but not in non-interactive shells)
if [[ $- == *i* ]]; then if [[ $- == *i* ]]; then
${pkgs.fastfetch}/bin/fastfetch --config /etc/fastfetch/config.jsonc ${pkgs.fastfetch}/bin/fastfetch --config /etc/fastfetch/config.jsonc
fi fi
# Color definitions
RESET="\[\033[0m\]"
BOLD="\[\033[1m\]"
# Colors
CYAN="\[\033[0;36m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
RED="\[\033[0;31m\]"
# Bold colors
BCYAN="\[\033[1;36m\]"
BBLUE="\[\033[1;34m\]"
BPURPLE="\[\033[1;35m\]"
BGREEN="\[\033[1;32m\]"
# Function to get git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Stylish prompt with icons
# Shows: ╭─ user@host ~/current/directory (git-branch)
# ╰─❯
PS1="${RESET}${BCYAN}${RESET} ${BPURPLE}\u${RESET}${CYAN}@${RESET}${BBLUE}\h${RESET} ${BGREEN} \w${RESET}${YELLOW}\$(parse_git_branch)${RESET}\n${BCYAN}${BPURPLE}${RESET} "
''; '';
} }