From 3d08572911fd7c5d90d820c4d77cc48203379b1f Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Fri, 30 Oct 2026 10:42:45 -0600 Subject: [PATCH] Initial dotfiles: nix + home-manager + plasma-manager, dot CLI, bootstrap Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc --- .gitignore | 4 + bin/dot | 433 ++++++++++++++ bootstrap.sh | 41 ++ config/browsers/chrome-pwas.json | 69 +++ config/browsers/edge-pwas.json | 30 + config/claude/CLAUDE.md | 133 +++++ config/claude/mcp.json | 42 ++ config/claude/settings.json | 26 + config/distrobox/distrobox.ini | 14 + config/flatpaks.txt | 29 + config/konsole/Dark.profile | 9 + config/konsole/Light.profile | 9 + config/konsole/etv.profile | 9 + config/konsole/general.profile | 9 + config/netbird/netbird.service | 14 + config/pi/mcp.json | 66 +++ config/pi/settings.json | 3 + .../dotfiles.nord.dark/contents/defaults | 29 + .../dotfiles.nord.dark/metadata.json | 13 + .../dotfiles.nord.light/contents/defaults | 29 + .../dotfiles.nord.light/metadata.json | 13 + config/ssh/config | 73 +++ config/vesktop/quickCss.css | 0 config/vesktop/vencord.json | 552 ++++++++++++++++++ config/vesktop/vesktop.json | 31 + config/vscodium/settings.json | 3 + config/xpipe/preferences.json | 12 + config/zed/settings.json | 11 + flake.lock | 89 +++ flake.nix | 70 +++ home/agents.nix | 15 + home/default.nix | 54 ++ home/dev.nix | 42 ++ home/files/pokefetch.zsh | 35 ++ home/git.nix | 23 + home/gui/apps.nix | 26 + home/gui/daynight.nix | 57 ++ home/gui/default.nix | 11 + home/gui/kde.nix | 138 +++++ home/gui/konsole.nix | 14 + home/gui/themes.nix | 25 + home/shell.nix | 61 ++ home/ssh.nix | 6 + scripts/daynight-hooks.py | 123 ++++ scripts/wallpaper-sort.py | 69 +++ 45 files changed, 2564 insertions(+) create mode 100644 .gitignore create mode 100755 bin/dot create mode 100755 bootstrap.sh create mode 100644 config/browsers/chrome-pwas.json create mode 100644 config/browsers/edge-pwas.json create mode 100644 config/claude/CLAUDE.md create mode 100644 config/claude/mcp.json create mode 100644 config/claude/settings.json create mode 100644 config/distrobox/distrobox.ini create mode 100644 config/flatpaks.txt create mode 100644 config/konsole/Dark.profile create mode 100644 config/konsole/Light.profile create mode 100644 config/konsole/etv.profile create mode 100644 config/konsole/general.profile create mode 100644 config/netbird/netbird.service create mode 100644 config/pi/mcp.json create mode 100644 config/pi/settings.json create mode 100644 config/plasma/look-and-feel/dotfiles.nord.dark/contents/defaults create mode 100644 config/plasma/look-and-feel/dotfiles.nord.dark/metadata.json create mode 100644 config/plasma/look-and-feel/dotfiles.nord.light/contents/defaults create mode 100644 config/plasma/look-and-feel/dotfiles.nord.light/metadata.json create mode 100644 config/ssh/config create mode 100644 config/vesktop/quickCss.css create mode 100644 config/vesktop/vencord.json create mode 100644 config/vesktop/vesktop.json create mode 100644 config/vscodium/settings.json create mode 100644 config/xpipe/preferences.json create mode 100644 config/zed/settings.json create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/agents.nix create mode 100644 home/default.nix create mode 100644 home/dev.nix create mode 100644 home/files/pokefetch.zsh create mode 100644 home/git.nix create mode 100644 home/gui/apps.nix create mode 100644 home/gui/daynight.nix create mode 100644 home/gui/default.nix create mode 100644 home/gui/kde.nix create mode 100644 home/gui/konsole.nix create mode 100644 home/gui/themes.nix create mode 100644 home/shell.nix create mode 100644 home/ssh.nix create mode 100644 scripts/daynight-hooks.py create mode 100644 scripts/wallpaper-sort.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cf646a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +result +result-* +*.hm-bak +.direnv/ diff --git a/bin/dot b/bin/dot new file mode 100755 index 0000000..2f2b0f9 --- /dev/null +++ b/bin/dot @@ -0,0 +1,433 @@ +#!/usr/bin/env bash +# dot — manage this dev environment. Run `dot help`. +set -euo pipefail + +DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}" +STATE_DIR="$HOME/.config/dotfiles" +SECRETS_ENV="$STATE_DIR/secrets.env" +GITEA_URL="https://gitea.godemperordoge.org" +WALLPAPER_REPO="$GITEA_URL/ziadarafat/wallpapers.git" +WALLPAPER_DIR="$HOME/Pictures/Wallpapers" +# Where wallpapers originally live on the Deck's external drive. +WALLPAPER_SRC_WORK="${WALLPAPER_SRC_WORK:-/run/media/deck/41e37da2-f67a-4c8c-96e8-78b21eab5bf6/backup/Pictures/ac_walls}" +WALLPAPER_SRC_PERSONAL="${WALLPAPER_SRC_PERSONAL:-/run/media/deck/41e37da2-f67a-4c8c-96e8-78b21eab5bf6/backup/Pictures/pokewalls/unprocessed}" + +mkdir -p "$STATE_DIR" + +c_blue=$'\e[34m'; c_yel=$'\e[33m'; c_red=$'\e[31m'; c_grn=$'\e[32m'; c_off=$'\e[0m' +step() { printf '%s==>%s %s\n' "$c_blue" "$c_off" "$*"; } +warn() { printf '%s!!%s %s\n' "$c_yel" "$c_off" "$*" >&2; } +die() { printf '%sxx%s %s\n' "$c_red" "$c_off" "$*" >&2; exit 1; } +ok() { printf '%sok%s %s\n' "$c_grn" "$c_off" "$*"; } +have() { command -v "$1" >/dev/null 2>&1; } + +os_id() { (. /etc/os-release 2>/dev/null && echo "${ID:-unknown}") || echo unknown; } +has_systemd() { [ -d /run/systemd/system ]; } +in_container() { [ -f /run/.containerenv ] || [ -f /.dockerenv ]; } + +source_nix() { + have nix && return 0 + for f in "$HOME/.nix-profile/etc/profile.d/nix.sh" /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh; do + # shellcheck disable=SC1090 + [ -e "$f" ] && . "$f" && break + done + have nix +} + +# sudo that works as root, with a TTY, or not at all. +SUDO() { + if [ "$(id -u)" = 0 ]; then "$@"; elif have sudo; then sudo "$@"; else die "need root for: $*"; fi +} + +# ---------------------------------------------------------------- profile +detect_profile() { + if [ "${XDG_CURRENT_DESKTOP:-}" = KDE ] || pgrep -x plasmashell >/dev/null 2>&1 || have plasmashell; then + echo full + else + echo headless + fi +} + +profile() { + if [ -s "$STATE_DIR/profile" ]; then cat "$STATE_DIR/profile"; else detect_profile; fi +} + +flake_attr() { + local p; p="$(profile)" + if [ "$p" = headless ] && [ "$(uname -m)" = aarch64 ]; then echo headless-aarch64; else echo "$p"; fi +} + +cmd_profile() { + case "${1:-}" in + full|headless) echo "$1" >"$STATE_DIR/profile"; ok "profile set to $1 (run: dot switch)";; + auto) rm -f "$STATE_DIR/profile"; ok "profile follows auto-detection ($(detect_profile))";; + "") echo "$(profile)$( [ -s "$STATE_DIR/profile" ] || echo ' (auto)')";; + *) die "usage: dot profile [full|headless|auto]";; + esac +} + +# ---------------------------------------------------------------- nix +cmd_nix() { + if source_nix; then ok "nix $(nix --version | awk '{print $NF}') present"; return; fi + local os; os="$(os_id)" + if [ "$os" = steamos ] || ! has_systemd || in_container; then + # Single-user: no daemon, nothing in /etc, so SteamOS updates can't break it. + # SteamOS bind-mounts /nix from /home/.steamos/offload/nix, so it persists. + step "installing Nix (single-user) into /nix" + if [ ! -w /nix ] 2>/dev/null; then + step "making /nix owned by $USER (one-time sudo)" + SUDO install -d -m 0755 -o "$(id -u)" -g "$(id -g)" /nix + SUDO chown "$(id -u):$(id -g)" /nix + fi + curl -fsSL https://nixos.org/nix/install | sh -s -- --no-daemon --no-modify-profile + else + step "installing Nix (multi-user, Determinate installer)" + curl -fsSL https://install.determinate.systems/nix | sh -s -- install --no-confirm + fi + source_nix || die "nix installed but not on PATH; open a new shell and re-run" + mkdir -p "$HOME/.config/nix" + grep -q flakes "$HOME/.config/nix/nix.conf" 2>/dev/null || echo "experimental-features = nix-command flakes" >>"$HOME/.config/nix/nix.conf" +} + +# ---------------------------------------------------------------- home-manager +cmd_switch() { + [ -n "${1:-}" ] && cmd_profile "$1" + source_nix || die "nix missing: run dot nix" + local attr; attr="$(flake_attr)" + step "home-manager switch → $attr" + export DOTFILES_DIR + if have home-manager; then + home-manager switch --flake "$DOTFILES_DIR#$attr" --impure -b hm-bak + else + nix run --inputs-from "$DOTFILES_DIR" home-manager -- switch --flake "$DOTFILES_DIR#$attr" --impure -b hm-bak + fi +} + +# ---------------------------------------------------------------- distro layer (sudo) +install_pkgs() { + local os; os="$(os_id)" + case "$os" in + steamos) return 0 ;; # read-only /usr; SteamOS already ships zsh, podman, distrobox, flatpak, Konsole + fedora) + local p=(zsh git curl podman distrobox flatpak) + [ "$(profile)" = full ] && p+=(konsole spectacle) + SUDO dnf install -y "${p[@]}" ;; + arch|cachyos|endeavouros|manjaro) + local p=(zsh git curl podman distrobox flatpak xz) + [ "$(profile)" = full ] && p+=(konsole spectacle kate) + SUDO pacman -Sy --needed --noconfirm "${p[@]}" ;; + almalinux|rhel|rocky) + SUDO dnf install -y zsh git curl podman flatpak ;; + debian|ubuntu) + SUDO apt-get update && SUDO apt-get install -y zsh git curl podman distrobox flatpak xz-utils ;; + *) warn "unknown distro '$os': install zsh, git, curl, podman, distrobox, flatpak yourself" ;; + esac +} + +browser_policies() { + # Flathub Chrome/Edge merge host policies from /run/host/etc/opt//policies. + for b in chrome edge; do + SUDO install -d -m 0755 "/etc/opt/$b/policies/managed" + SUDO install -m 0644 "$DOTFILES_DIR/config/browsers/$b-pwas.json" "/etc/opt/$b/policies/managed/dotfiles-pwas.json" + done + ok "Chrome/Edge PWA policies installed (apply on next browser start)" +} + +netbird_service() { + local bin="$HOME/.nix-profile/bin/netbird" + [ -x "$bin" ] || { warn "netbird not in nix profile; skipping"; return; } + has_systemd || { warn "no systemd; skipping netbird service"; return; } + sed "s|@NETBIRD@|$bin|" "$DOTFILES_DIR/config/netbird/netbird.service" | SUDO tee /etc/systemd/system/netbird.service >/dev/null + SUDO systemctl daemon-reload + SUDO systemctl enable --now netbird.service + ok "netbird daemon running ($bin)" +} + +cmd_system() { + local skip_pkgs=0 netbird=0 + for a in "$@"; do case "$a" in --no-pkgs) skip_pkgs=1;; --netbird) netbird=1;; esac; done + [ "$(profile)" = full ] && netbird=1 + step "distro layer for $(os_id) (needs sudo)" + [ $skip_pkgs = 1 ] || install_pkgs + if [ "$(profile)" = full ]; then + browser_policies + fi + [ $netbird = 1 ] && netbird_service + local zsh_path; zsh_path="$(command -v zsh || true)" + if [ -n "$zsh_path" ] && [ "$(getent passwd "$USER" | cut -d: -f7)" != "$zsh_path" ]; then + grep -qx "$zsh_path" /etc/shells || echo "$zsh_path" | SUDO tee -a /etc/shells >/dev/null + SUDO chsh -s "$zsh_path" "$USER" && ok "login shell → $zsh_path" || warn "chsh failed; bash will hand off to zsh instead" + fi +} + +# ---------------------------------------------------------------- user apps +flatpak_has() { flatpak info "$1" >/dev/null 2>&1; } + +cmd_apps() { + if [ "$(profile)" = full ] && have flatpak; then + step "Flatpaks (user scope)" + flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + local missing=() + while read -r app; do + [ -z "$app" ] || [[ "$app" == \#* ]] && continue + flatpak_has "$app" || missing+=("$app") + done <"$DOTFILES_DIR/config/flatpaks.txt" + if [ ${#missing[@]} -gt 0 ]; then + flatpak install --user --noninteractive --or-update flathub "${missing[@]}" || warn "some Flatpaks failed (sandboxed containers can't run flatpak)" + fi + ok "Flatpaks: ${#missing[@]} installed, rest already present" + seed_xpipe + fi + + step "mise tools" + if have mise; then + mise install -y || warn "mise install had failures" + fi + + if [ ! -x "$HOME/.local/bin/claude" ]; then + step "Claude Code (native installer)" + curl -fsSL https://claude.ai/install.sh | bash || warn "Claude Code install failed" + else + ok "Claude Code present" + fi +} + +seed_xpipe() { + local prefs="$HOME/.xpipe/settings/preferences.json" + [ -e "$prefs" ] && return + mkdir -p "$(dirname "$prefs")" + cp "$DOTFILES_DIR/config/xpipe/preferences.json" "$prefs" + ok "XPipe set to sync from RustyRaptor/xpipe-sync (enter the GitHub token on first launch)" +} + +cmd_boxes() { + have distrobox || die "distrobox missing (dot system)" + distrobox assemble create --file "$HOME/.config/distrobox/distrobox.ini" +} + +# ---------------------------------------------------------------- secrets (Bitwarden) +BW_PREFIX="dotfiles" + +bw_ready() { + have bw || die "bitwarden-cli missing (dot switch)" + local status; status="$(bw status | jq -r .status)" + case "$status" in + unlocked) return 0 ;; + unauthenticated) die "run: bw login then: export BW_SESSION=\$(bw unlock --raw)" ;; + locked) die "run: export BW_SESSION=\$(bw unlock --raw)" ;; + esac +} + +bw_find() { bw list items --search "$1" | jq -c --arg n "$1" 'first(.[] | select(.name == $n)) // empty'; } + +bw_put_note() { # name, notes-file + local name="$1" file="$2" existing + existing="$(bw_find "$name")" + if [ -n "$existing" ]; then + echo "$existing" | jq --rawfile n "$file" '.notes = $n' | bw encode | bw edit item "$(echo "$existing" | jq -r .id)" >/dev/null + else + bw get template item | jq --arg name "$name" --rawfile n "$file" \ + '.type = 2 | .secureNote = {type: 0} | .name = $name | .notes = $n | .login = null' \ + | bw encode | bw create item >/dev/null + fi + ok "bitwarden: $name" +} + +bw_get_note() { bw_find "$1" | jq -r '.notes // empty'; } + +secrets_push() { + bw_ready; bw sync >/dev/null + [ -s "$SECRETS_ENV" ] && bw_put_note "$BW_PREFIX/secrets.env" "$SECRETS_ENV" + for k in "$HOME"/.ssh/id_ed25519 "$HOME"/.ssh/id_rsa; do + [ -f "$k" ] && bw_put_note "$BW_PREFIX/ssh/$(basename "$k")" "$k" + [ -f "$k.pub" ] && bw_put_note "$BW_PREFIX/ssh/$(basename "$k").pub" "$k.pub" + done + if have nmcli; then + local tmp; tmp="$(mktemp -d)" + while IFS=: read -r name type; do + [ "$type" = wireguard ] || continue + SUDO cat "/etc/NetworkManager/system-connections/$name.nmconnection" >"$tmp/$name" 2>/dev/null \ + && bw_put_note "$BW_PREFIX/wireguard/$name.nmconnection" "$tmp/$name" + done < <(nmcli -t -f NAME,TYPE connection show) + rm -rf "$tmp" + fi +} + +secrets_pull() { + bw_ready; bw sync >/dev/null + local v + v="$(bw_get_note "$BW_PREFIX/secrets.env")" + if [ -n "$v" ]; then (umask 077; printf '%s\n' "$v" >"$SECRETS_ENV"); ok "secrets.env"; fi + mkdir -p "$HOME/.ssh"; chmod 700 "$HOME/.ssh" + while read -r name; do + [ -n "$name" ] || continue + local f="$HOME/.ssh/${name##*/}" + (umask 077; bw_get_note "$name" >"$f") + [[ "$f" == *.pub ]] && chmod 644 "$f" + ok "$f" + done < <(bw list items --search "$BW_PREFIX/ssh/" | jq -r '.[].name' | grep "^$BW_PREFIX/ssh/") + if [ "${1:-}" = --wireguard ] && have nmcli; then + while read -r name; do + [ -n "$name" ] || continue + local base="${name##*/}" + bw_get_note "$name" | SUDO install -m 600 /dev/stdin "/etc/NetworkManager/system-connections/$base" + ok "wireguard $base" + done < <(bw list items --search "$BW_PREFIX/wireguard/" | jq -r '.[].name' | grep "^$BW_PREFIX/wireguard/") + SUDO nmcli connection reload + fi + secrets_render +} + +# Fill ${VAR} placeholders in MCP templates from secrets.env and merge them in. +secrets_render() { + [ -s "$SECRETS_ENV" ] || { warn "no $SECRETS_ENV (dot secrets pull)"; return; } + set -a; # shellcheck disable=SC1090 + . "$SECRETS_ENV"; set +a + local render='walk(if type == "string" then gsub("\\$\\{(?[A-Z_]+)\\}"; "\(env[.v] // "")") else . end)' + + local claude_json="$HOME/.claude.json" + [ -f "$claude_json" ] || echo '{}' >"$claude_json" + jq --slurpfile m <(jq "$render" "$DOTFILES_DIR/config/claude/mcp.json") '.mcpServers = ((.mcpServers // {}) + $m[0])' \ + "$claude_json" >"$claude_json.tmp" && mv "$claude_json.tmp" "$claude_json" && chmod 600 "$claude_json" + ok "Claude MCP servers" + + mkdir -p "$HOME/.pi/agent" + (umask 077; jq "$render" "$DOTFILES_DIR/config/pi/mcp.json" >"$HOME/.pi/agent/mcp.json") + ok "pi MCP servers" + + # HTTPS git auth for the forges (credential.helper=store). + (umask 077; { + [ -n "${GITEA_DOGE_TOKEN:-}" ] && echo "https://ziadarafat:$GITEA_DOGE_TOKEN@gitea.godemperordoge.org" + [ -n "${ETV_GITEA_TOKEN:-}" ] && echo "https://ziadarafat:$ETV_GITEA_TOKEN@gitea.etvamerica.com" + [ -n "${GITHUB_ACCESS_TOKEN:-}" ] && echo "https://RustyRaptor:$GITHUB_ACCESS_TOKEN@github.com" + } >"$HOME/.git-credentials") + ok "git credentials" +} + +cmd_secrets() { + case "${1:-}" in + push) secrets_push ;; + pull) shift; secrets_pull "$@" ;; + render) secrets_render ;; + *) die "usage: dot secrets push|pull [--wireguard]|render" ;; + esac +} + +# ---------------------------------------------------------------- wallpapers +cmd_wallpapers() { + if [ -d "$WALLPAPER_SRC_WORK" ] || [ -d "$WALLPAPER_SRC_PERSONAL" ]; then + have wallpaper-sort || die "wallpaper-sort missing (full profile)" + [ -d "$WALLPAPER_SRC_WORK" ] && wallpaper-sort "$WALLPAPER_SRC_WORK" "$WALLPAPER_DIR/work" + [ -d "$WALLPAPER_SRC_PERSONAL" ] && wallpaper-sort "$WALLPAPER_SRC_PERSONAL" "$WALLPAPER_DIR/personal" + if [ -d "$WALLPAPER_DIR/.git" ] && [ "${1:-}" = --push ]; then + git -C "$WALLPAPER_DIR" add -A && git -C "$WALLPAPER_DIR" commit -qm "wallpapers: resort $(date -I)" && git -C "$WALLPAPER_DIR" push -q || true + fi + elif [ ! -d "$WALLPAPER_DIR/.git" ]; then + step "cloning wallpapers" + git clone --depth 1 "$WALLPAPER_REPO" "$WALLPAPER_DIR" || warn "wallpaper clone failed (dot secrets pull for git credentials?)" + else + git -C "$WALLPAPER_DIR" pull -q --ff-only || true + fi + have daynight-hooks && daynight-hooks --once >/dev/null 2>&1 || true +} + +# ---------------------------------------------------------------- sounds +cmd_sounds() { + have build-sound-theme || die "build-sound-theme missing (full profile)" + build-sound-theme "$@" +} + +# ---------------------------------------------------------------- update / doctor +cmd_update() { + step "pull dotfiles" + git -C "$DOTFILES_DIR" pull --rebase --autostash || warn "git pull failed; continuing with local tree" + if [ "${1:-}" = --inputs ]; then + step "nix flake update" + source_nix && nix flake update --flake "$DOTFILES_DIR" + fi + cmd_switch + [ "$(profile)" = full ] && have flatpak && { step "flatpak update"; flatpak update --user -y --noninteractive || true; } + have mise && { step "mise upgrade"; mise upgrade -y || true; } + have claude && { step "claude update"; claude update || true; } + cmd_apps +} + +cmd_doctor() { + local p; p="$(profile)" + printf 'os=%s profile=%s container=%s systemd=%s\n' "$(os_id)" "$p" "$(in_container && echo yes || echo no)" "$(has_systemd && echo yes || echo no)" + chk() { if eval "$2" >/dev/null 2>&1; then ok "$1"; else warn "$1 — $3"; fi; } + chk "nix" "source_nix" "dot nix" + chk "home-manager" "have home-manager" "dot switch" + chk "zsh + oh-my-zsh" "have zsh && [ -d \"\$(dirname \"\$(readlink -f ~/.zshrc)\")\" ]" "dot switch" + chk "mise" "have mise" "dot switch" + chk "uv" "have uv || mise which uv" "dot apps" + chk "pi" "have pi || mise which pi" "dot apps" + chk "pokemon-go-colorscripts" "have pokemon-go-colorscripts || mise which pokemon-go-colorscripts" "dot apps" + chk "claude" "[ -x ~/.local/bin/claude ]" "dot apps" + chk "podman" "have podman" "dot system" + chk "distrobox" "have distrobox" "dot system" + chk "ssh key" "[ -f ~/.ssh/id_ed25519 ]" "dot secrets pull" + chk "secrets.env" "[ -s $SECRETS_ENV ]" "dot secrets pull" + if [ "$p" = full ]; then + chk "flatpak" "have flatpak" "dot system" + while read -r app; do + [ -z "$app" ] || [[ "$app" == \#* ]] && continue + chk "flatpak $app" "flatpak_has $app" "dot apps" + done <"$DOTFILES_DIR/config/flatpaks.txt" + chk "Chrome PWA policy" "[ -f /etc/opt/chrome/policies/managed/dotfiles-pwas.json ]" "dot system" + chk "Edge PWA policy" "[ -f /etc/opt/edge/policies/managed/dotfiles-pwas.json ]" "dot system" + chk "wallpapers" "[ -d $WALLPAPER_DIR/personal ]" "dot wallpapers" + chk "konsole-daynight service" "systemctl --user is-active konsole-daynight" "dot switch, then log in to Plasma" + chk "daynight-hooks service" "systemctl --user is-active daynight-hooks" "dot switch, then log in to Plasma" + chk "netbird daemon" "systemctl is-active netbird" "dot system --netbird" + fi +} + +cmd_bootstrap() { + local sys=1; [ "${DOTFILES_SKIP_SYSTEM:-0}" = 1 ] && sys=0 + [ $sys = 1 ] && { install_pkgs || warn "distro packages incomplete; re-run: dot system"; } + cmd_nix + cmd_switch + [ $sys = 1 ] && { cmd_system --no-pkgs || warn "system layer incomplete; re-run: dot system"; } + # The new profile puts mise & friends on PATH. + export PATH="$HOME/.nix-profile/bin:$HOME/.local/bin:$PATH" + cmd_apps + [ "$(profile)" = full ] && { cmd_wallpapers || true; } + cat </dev/null 2>&1; } +as_root() { if [ "$(id -u)" = 0 ]; then "$@"; else sudo "$@"; fi; } + +if ! need git || ! need curl || ! need xz; then + echo "==> installing git/curl/xz" + . /etc/os-release + case "$ID" in + fedora|almalinux|rhel|rocky) as_root dnf install -y git curl xz ;; + arch|cachyos|endeavouros|manjaro) as_root pacman -Sy --needed --noconfirm git curl xz ;; + debian|ubuntu) as_root apt-get update && as_root apt-get install -y git curl xz-utils ;; + steamos) ;; # ships all three + *) echo "install git, curl and xz, then re-run" >&2; exit 1 ;; + esac +fi + +if [ ! -d "$DIR/.git" ]; then + echo "==> cloning dotfiles into $DIR" + auth=() + [ -n "${GITEA_TOKEN:-}" ] && auth=(-c "http.extraHeader=Authorization: token $GITEA_TOKEN") + git "${auth[@]}" clone --branch "$REF" "$REPO" "$DIR" +fi + +mkdir -p "$HOME/.config/dotfiles" +[ -n "${DOTFILES_PROFILE:-}" ] && echo "$DOTFILES_PROFILE" >"$HOME/.config/dotfiles/profile" + +export DOTFILES_DIR="$DIR" +exec "$DIR/bin/dot" bootstrap diff --git a/config/browsers/chrome-pwas.json b/config/browsers/chrome-pwas.json new file mode 100644 index 0000000..eebdea0 --- /dev/null +++ b/config/browsers/chrome-pwas.json @@ -0,0 +1,69 @@ +{ + "WebAppInstallForceList": [ + { + "url": "https://www.snapchat.com/web", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://claude.ai/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://mail.google.com/mail/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://metazooa.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://flora.metazooa.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://www.youtube.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://www.tiktok.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://app.diagrams.net/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://messages.google.com/web/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://contacts.google.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://github.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://excalidraw.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://jellyfin.godemperordoge.org/", + "default_launch_container": "window", + "create_desktop_shortcut": true + } + ] +} \ No newline at end of file diff --git a/config/browsers/edge-pwas.json b/config/browsers/edge-pwas.json new file mode 100644 index 0000000..32e914e --- /dev/null +++ b/config/browsers/edge-pwas.json @@ -0,0 +1,30 @@ +{ + "WebAppInstallForceList": [ + { + "url": "https://teams.microsoft.com/v2/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://outlook.office.com/mail/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://claude.ai/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://wikijs.etvamerica.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + }, + { + "url": "https://gitea.etvamerica.com/", + "default_launch_container": "window", + "create_desktop_shortcut": true + } + ], + "BrowserSignin": 1 +} \ No newline at end of file diff --git a/config/claude/CLAUDE.md b/config/claude/CLAUDE.md new file mode 100644 index 0000000..53a31f5 --- /dev/null +++ b/config/claude/CLAUDE.md @@ -0,0 +1,133 @@ +# Environment Profile: Steam Deck (SteamOS) + +You are running on a **Steam Deck** powered by SteamOS (an immutable Arch Linux-based system). Keep these core constraints, container environments, and remote access workflows in mind: + +## System Constraints +- **Immutable Root:** The host root filesystem (`/`) is read-only. Never attempt to use `pacman` or write files directly to system paths on the host. +- **Package Management & Apps:** + - Desktop/GUI applications must be installed via **Flatpak** (`flatpak install`). + - Development environments, CLI tools, and Linux utilities must be isolated inside **Distrobox** containers. +- **Service Management:** System services run via user-space `systemd` or inside containers. + +## Configured Distrobox Containers +1. **`etv`** + - **Base Image:** `almalinux 10-toolbox` + - **Scope:** Reserved strictly for ETV work projects, Enterprise Linux tooling, and ETV-specific dependencies. + - **Command execution:** `distrobox enter ETV` or `distrobox-enter -n ETV -- ` + +2. **`general`** + - **Base Image:** Fedora (latest toolbox) + - **Scope:** General development, testing, personal CLI tools, and daily workflows. + - **Command execution:** `distrobox enter general` or `distrobox-enter -n general -- ` + +## Remote Access Protocol (SSH Config + XPipe Key Management) +- **Primary Method (SSH + SSH Config):** For remote systems, use native `ssh` referencing configured hosts in SSH config files (`~/.ssh/config`) first. + - Always reference explicit host aliases defined in the SSH config. +- **Key Transfer & Re-establishment (XPipe):** XPipe is unreliable for frequent remote session access and should **not** be used for primary command execution. + - Use XPipe **only** when needed to transfer SSH keys, manage credentials, or re-establish/bootstrap remote access configuration. + +## Remote Infrastructure & Proxmox VE Protocol + +All remote management of host systems, Proxmox VE nodes, and virtual machines must be executed **exclusively using native Linux CLI tools** (`ssh`, `qm`, `pct`, `pvesm`, `pvecm`, `podman`) via local terminal execution using SSH config aliases. **Do not use third-party Proxmox MCP tools.** + +### Host Naming & Resolution Rules (via SSH Config) +1. **Configured Aliases:** Use defined SSH config host aliases for all connections. +2. **Privileges:** Operations involving Proxmox configuration, VM lifecycle (`qm`), or container management (`pct`) require root privileges. + +--- + +### ETV Subcategory Inventory + +#### Proxmox VE Cluster Nodes +- **`fenrir`** (use with root privileges via SSH for Proxmox management commands) + - *Hardware:* Proxmox VE Node with an active NVIDIA GPU. + - *CLI Tools:* `qm`, `pct`, `pvesm`, `pvecm`, `nvidia-smi` +- **`r2d2`** + - *Hardware:* Proxmox VE Cluster Node. +- **`gryphus`** + - *Hardware:* Proxmox VE Cluster Node. +- **`spyro`** + - *Hardware:* Proxmox VE Cluster Node. +- **`johnserver`** + - *Status:* **SHUTDOWN** until further notice. Do not connect automatically. + +#### Production & Development Virtual Machines (`ETV`) +- **`allmind`**: Main AlmaLinux production server running containerized core services (Gitea, Wiki.js) via Podman. SELinux is **enabled**. +- **`ayre`**: **Shutdown.** Ubuntu 22.04 VM with passed-through GPU for heavy simulation (NVIDIA Isaac Sim, UE5, Gazebo). +- **`raven`**: AI/ML development VM powered by an NVIDIA RTX 2070 Super with NVIDIA Container Runtime for remote desktop/AI containers. +- **`rusty`**: Staging/sandbox VM. SELinux is **disabled** for rapid prototyping and raw binary testing. + +#### Infrastructure & Edge Compute (`ETV`) +- **`etv`**: Rack server running Ubuntu 24.04 handling backups and data archives (planned migration to Proxmox Backup Server). +- **`yoda`**: NVIDIA Jetson Nano edge compute node for testing ARM64 and embedded AI workloads. + +## Available Tooling & Commands +- **Flatpak Management:** + - Search apps: `flatpak search ` + - Install apps: `flatpak install flathub ` + - Run apps: `flatpak run ` +- **Distrobox Management:** + - List containers: `distrobox list` + - Enter container: `distrobox enter ` + - Run command in container: `distrobox-enter -n -- ` + - Export app to host: `distrobox-export --app ` + +## Guidelines for Claude +- Primary connection attempt for remote servers: **Native `ssh` using SSH config files**. +- XPipe usage: Use **XPipe** strictly for transferring keys and re-establishing/bootstrapping remote access configuration when needed. +- For ETV work tasks: Use the **`ETV`** container (`almalinux 10-toolbox`). +- For general coding/utilities: Use the **`general`** container (Fedora). +- For desktop applications: Check **Flatpak** first. + +## Infrastructure Discovery & Collaborative Documentation + +To maintain an accurate, shared source of truth across the engineering team, follow these protocols when interacting with network hosts, Proxmox nodes, and VMs: + +### 1. Proactive Discovery & Machine Profiles +- When exploring or configuring a machine, actively discover and note host-specific architecture details (e.g., custom mount points like `raven`'s 500GB Vdisk at `/data` dedicated to Podman storage and large data, GPU device paths, custom network bridges, or local storage pools). +- Keep track of operational quirks, SELinux states, and service topologies per host. + +### 2. Collaborative Documentation via Wiki.js +- **Shared Source of Truth:** Whenever significant configuration details, persistent paths, troubleshooting steps, or architectural setups are discovered or modified, document them in **Wiki.js** (which automatically syncs to the Gitea Documentation repository). +- **Target Audience:** Write documentation clearly and comprehensively so it serves as a robust knowledge base for **both Claude (for future context retention) and human engineers**. +- **Modern Documentation Standards:** + - Use structured markdown with clean heading hierarchies. + - Use **tables** for hardware specs, mount points, and port mappings. + - Use **Mermaid diagrams** for visualizing complex container networks or infrastructure topologies where appropriate. + - Keep configuration examples copy-paste ready and properly fenced. + +## Knowledge Base & Documentation Strategy + +### 1. Wiki.js & Two-Way Git Sync +- **Primary Knowledge Base:** Wiki.js (`https://wikijs.etvamerica.com/`) is the central repository for general engineering knowledge, operational notes, and system documentation. +- **Direct Git Access:** Wiki.js maintains a two-way sync with a Gitea Git repository: `https://gitea.etvamerica.com/Emerging-Technology-Ventures/Documentation.git`. +- **Efficiency Rule:** When performing bulk reads, searching through historical markdown files, or performing heavy documentation updates, Claude may clone/pull or interact directly with this Git repository via SSH/Gitea if it is faster or more reliable than querying the Wiki.js MCP API. + +### 2. Where to Document Information +- **General & Organizational Knowledge:** Document in **Wiki.js** (or directly in the Documentation Git repository). +- **Software Project Documentation:** If documentation belongs directly to a specific software project or code repository, store and update it inside that project's respective repository using `README.md` and dedicated markdown files hosted on Gitea. Especially if it is technical documentation. However non technical documentation should still exist on wikijs to at the very least point to the gitea repo page so people can find it. + +## Web Search & Browser Automation +- **Web Search (SearXNG):** Use the `searxng` MCP server for all live web searches, duckduckgo/google aggregation, and privacy-focused query retrieval. +- **Browser Automation (Playwright):** Use the `playwright` MCP server with Chromium when interactive DOM rendering, form handling, or page screenshots are required. + + +## Preferred Tech Stack & Development Tools + +When designing, developing, or setting up projects, strictly adhere to these tool and environment preferences: + +### 1. Tool Management & Environments +- **`mise` (`mise-en-place`):** Primary tool for managing runtime versions, CLI utilities, and reproducible development environments (`https://mise.jdx.dev/`). + +### 2. Language & Package Ecosystems +- **Python:** Always use **`uv`** for virtual environment creation, package installation, dependency management, and script execution. +- **JavaScript / TypeScript:** Always use **`bun`** for package management, script running, and JS/TS execution. +- **Long-Term Services & Tools:** Prefer **Go (Golang)** or **Python** when building production-grade, long-term tools or standalone services. + +### 3. Containerization +- **Podman:** Strictly use **Podman** (rootless, systemd integration, quadlets) for all container workloads. Avoid Docker commands or Dockerfiles unless container compatibility explicitly requires it. + +### 4. Linux Distribution Preferences +- **Enterprise / Production:** **AlmaLinux 9 or 10** (preferred for enterprise-grade stability and servers). +- **Modern / Testing:** **Fedora** (preferred when a newer toolchain or modern upstream package set is needed). +- **Other Distros:** Always **defer to the user** before introducing or targeting a different Linux distribution. diff --git a/config/claude/mcp.json b/config/claude/mcp.json new file mode 100644 index 0000000..c7f74c7 --- /dev/null +++ b/config/claude/mcp.json @@ -0,0 +1,42 @@ +{ + "playwright": { + "type": "stdio", + "command": "npx", + "args": ["@playwright/mcp@latest"], + "env": {} + }, + "searxng": { + "type": "stdio", + "command": "npx", + "args": ["@tobioffice/mcp-searxng@latest"], + "env": { "SEARXNG_URL": "https://google.godemperordoge.org" } + }, + "wiki": { + "type": "stdio", + "command": "npx", + "args": ["-y", "@yowu-dev/requarks-wiki-mcp@latest"], + "env": { + "WIKI_BASE_URL": "https://wikijs.etvamerica.com/", + "WIKI_API_TOKEN": "${WIKI_API_TOKEN}", + "WIKI_MUTATIONS_ENABLED": "true", + "WIKI_MUTATION_DRY_RUN": "false" + } + }, + "gitea": { + "type": "stdio", + "command": "${HOME}/.nix-profile/bin/gitea-mcp", + "args": ["-H", "https://gitea.etvamerica.com", "-T", "${ETV_GITEA_TOKEN}"], + "env": {} + }, + "mise-en-place": { + "type": "stdio", + "command": "${HOME}/.nix-profile/bin/mise", + "args": ["mcp"], + "env": { "MISE_EXPERIMENTAL": "1" } + }, + "xpipe": { + "type": "http", + "url": "http://localhost:21721/mcp", + "headers": { "Authorization": "Bearer ${XPIPE_MCP_TOKEN}" } + } +} diff --git a/config/claude/settings.json b/config/claude/settings.json new file mode 100644 index 0000000..402a05b --- /dev/null +++ b/config/claude/settings.json @@ -0,0 +1,26 @@ +{ + "permissions": { + "allow": [ + "mcp__xpipe__run_command", + "mcp__xpipe", + "mcp__gitea", + "mcp__wiki", + "Bash(ssh:*)", + "Bash(scp:*)", + "Bash(rsync:*)" + ] + }, + "modelSettings": { + "claude-opus-5-5": { + "effortLevel": "high" + } + }, + "voice": { + "enabled": true, + "mode": "hold" + }, + "skipDangerousModePermissionPrompt": true, + "theme": "auto", + "voiceEnabled": true, + "agentPushNotifEnabled": true +} \ No newline at end of file diff --git a/config/distrobox/distrobox.ini b/config/distrobox/distrobox.ini new file mode 100644 index 0000000..e6cc286 --- /dev/null +++ b/config/distrobox/distrobox.ini @@ -0,0 +1,14 @@ +# `distrobox assemble create --file ~/.config/distrobox/distrobox.ini` (or `dot boxes`) +[general] +image=registry.fedoraproject.org/fedora-toolbox:latest +pull=true +additional_packages="zsh git" +init=false +start_now=false + +[etv] +image=docker.io/almalinux/10-toolbox:latest +pull=true +additional_packages="zsh git" +init=false +start_now=false diff --git a/config/flatpaks.txt b/config/flatpaks.txt new file mode 100644 index 0000000..41d10dc --- /dev/null +++ b/config/flatpaks.txt @@ -0,0 +1,29 @@ +# Installed per-user from Flathub by `dot apps` (skipped if already installed system-wide). +# Dev +dev.zed.Zed +com.vscodium.codium +org.kde.kate +com.usebruno.Bruno +com.bitwarden.desktop +com.github.tchx84.Flatseal +# Browsers +com.microsoft.Edge +com.google.Chrome +org.chromium.Chromium +org.mozilla.firefox +# Communication +org.telegram.desktop +dev.vencord.Vesktop +# Media / creative +org.gimp.GIMP +org.kde.krita +org.blender.Blender +com.obsproject.Studio +org.kde.kdenlive +org.videolan.VLC +io.mpv.Mpv +# Office / utilities +org.kde.okular +org.libreoffice.LibreOffice +org.kde.filelight +io.github.IshuSinghSE.aurynk diff --git a/config/konsole/Dark.profile b/config/konsole/Dark.profile new file mode 100644 index 0000000..441a8db --- /dev/null +++ b/config/konsole/Dark.profile @@ -0,0 +1,9 @@ +[Appearance] +ColorScheme=Breeze +Font=Hack Nerd Font Mono,11,-1,5,400,0,0,0,0,0,0,0,0,0,0,1 + +[General] +Command=zsh +Environment=TERM=xterm-256color,COLORTERM=truecolor +Name=Dark +Parent=FALLBACK/ diff --git a/config/konsole/Light.profile b/config/konsole/Light.profile new file mode 100644 index 0000000..bb3c61e --- /dev/null +++ b/config/konsole/Light.profile @@ -0,0 +1,9 @@ +[Appearance] +ColorScheme=SolarizedLight +Font=Hack Nerd Font Mono,11,-1,5,400,0,0,0,0,0,0,0,0,0,0,1 + +[General] +Command=zsh +Environment=TERM=xterm-256color,COLORTERM=truecolor +Name=Light +Parent=FALLBACK/ diff --git a/config/konsole/etv.profile b/config/konsole/etv.profile new file mode 100644 index 0000000..7291a15 --- /dev/null +++ b/config/konsole/etv.profile @@ -0,0 +1,9 @@ +[Appearance] +ColorScheme=SolarizedLight + +[General] +Command=distrobox enter etv +Environment=TERM=xterm-256color,COLORTERM=truecolor +InheritContainerContext=true +Name=etv +Parent=FALLBACK/ diff --git a/config/konsole/general.profile b/config/konsole/general.profile new file mode 100644 index 0000000..c91cd45 --- /dev/null +++ b/config/konsole/general.profile @@ -0,0 +1,9 @@ +[Appearance] +ColorScheme=SolarizedLight + +[General] +Command=distrobox enter general +Environment=TERM=xterm-256color,COLORTERM=truecolor +InheritContainerContext=false +Name=general +Parent=FALLBACK/ diff --git a/config/netbird/netbird.service b/config/netbird/netbird.service new file mode 100644 index 0000000..95b75f6 --- /dev/null +++ b/config/netbird/netbird.service @@ -0,0 +1,14 @@ +# Installed to /etc/systemd/system by `dot system`. Points at the user's Nix +# profile so the binary survives Nix GC and SteamOS updates. +[Unit] +Description=NetBird mesh VPN client +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=@NETBIRD@ service run --config /var/lib/netbird/config.json --log-file console +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/config/pi/mcp.json b/config/pi/mcp.json new file mode 100644 index 0000000..e4c5b47 --- /dev/null +++ b/config/pi/mcp.json @@ -0,0 +1,66 @@ +{ + "mcpServers": { + "websearch-simple": { + "url": "https://RivalSearchMCP.fastmcp.app/mcp", + "exposure": "direct" + }, + "wiki": { + "command": "npx", + "args": [ + "-y", + "@yowu-dev/requarks-wiki-mcp@latest" + ], + "env": { + "WIKI_BASE_URL": "https://wikijs.etvamerica.com/", + "WIKI_API_TOKEN": "${WIKI_API_TOKEN}", + "WIKI_MUTATIONS_ENABLED": "true", + "WIKI_MUTATION_DRY_RUN": "false" + }, + "exposure": "direct" + }, + "mise-en-place": { + "command": "${HOME}/.nix-profile/bin/mise", + "args": [ + "mcp" + ], + "env": { + "MISE_EXPERIMENTAL": "1" + }, + "exposure": "direct" + }, + "playwright-browser-automation": { + "command": "npx", + "args": [ + "@playwright/mcp@latest", + "--extension" + ], + "env": { + "PLAYWRIGHT_MCP_EXECUTABLE_PATH": "${HOME}/chrome.sh", + "PLAYWRIGHT_MCP_EXTENSION_TOKEN": "${PLAYWRIGHT_MCP_EXTENSION_TOKEN}" + }, + "exposure": "direct" + }, + "web-search-advanced": { + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/Shelpuk-AI-Technology-Consulting/kindly-web-search-mcp-server", + "kindly-web-search-mcp-server", + "start-mcp-server" + ], + "env": { + "SEARXNG_BASE_URL": "https://google.godemperordoge.org/", + "SEARXNG_USER_AGENT": "Mozilla/5.0 ..." + } + }, + "gitea": { + "command": "${HOME}/.nix-profile/bin/gitea-mcp", + "args": [ + "-H", + "https://gitea.etvamerica.com", + "-T", + "${ETV_GITEA_TOKEN}" + ] + } + } +} \ No newline at end of file diff --git a/config/pi/settings.json b/config/pi/settings.json new file mode 100644 index 0000000..fcc2454 --- /dev/null +++ b/config/pi/settings.json @@ -0,0 +1,3 @@ +{ + "lastChangelogVersion": "1.3.0" +} \ No newline at end of file diff --git a/config/plasma/look-and-feel/dotfiles.nord.dark/contents/defaults b/config/plasma/look-and-feel/dotfiles.nord.dark/contents/defaults new file mode 100644 index 0000000..b109e78 --- /dev/null +++ b/config/plasma/look-and-feel/dotfiles.nord.dark/contents/defaults @@ -0,0 +1,29 @@ +[KSplash] +Theme=Utterly-Nord-Solid + +[kcminputrc][Mouse] +cursorTheme=Nordic-cursors + +[kdeglobals][General] +ColorScheme=UtterlyNord + +[kdeglobals][Icons] +Theme=Tela-circle-nord-dark + +[kdeglobals][KDE] +widgetStyle=Breeze + +[kwinrc][DesktopSwitcher] +LayoutName=org.kde.breeze.desktop + +[kwinrc][WindowSwitcher] +LayoutName=thumbnail_grid + +[kwinrc][org.kde.kdecoration2] +ButtonsOnLeft=XAI +ButtonsOnRight= +library=org.kde.kwin.aurorae +theme=__aurorae__svg__Utterly-Round-Dark-Solid + +[plasmarc][Theme] +name=Utterly-Round-Solid diff --git a/config/plasma/look-and-feel/dotfiles.nord.dark/metadata.json b/config/plasma/look-and-feel/dotfiles.nord.dark/metadata.json new file mode 100644 index 0000000..8d56201 --- /dev/null +++ b/config/plasma/look-and-feel/dotfiles.nord.dark/metadata.json @@ -0,0 +1,13 @@ +{ + "KPackageStructure": "Plasma/LookAndFeel", + "KPlugin": { + "Authors": [{ "Name": "dotfiles" }], + "Category": "Global Themes (Plasma 6)", + "Description": "Utterly Nord Dark (Solid) with Breeze widgets; leaves the wallpaper alone so slideshows survive day/night switches", + "Id": "dotfiles.nord.dark", + "License": "GPL-2.0+", + "Name": "Nord Dark (dotfiles)", + "Version": "1.0" + }, + "X-Plasma-APIVersion": "2" +} diff --git a/config/plasma/look-and-feel/dotfiles.nord.light/contents/defaults b/config/plasma/look-and-feel/dotfiles.nord.light/contents/defaults new file mode 100644 index 0000000..d509da8 --- /dev/null +++ b/config/plasma/look-and-feel/dotfiles.nord.light/contents/defaults @@ -0,0 +1,29 @@ +[KSplash] +Theme=Utterly-Nord-Light-Solid + +[kcminputrc][Mouse] +cursorTheme=Nordic-cursors + +[kdeglobals][General] +ColorScheme=UtterlyNordLight + +[kdeglobals][Icons] +Theme=Tela-circle-nord + +[kdeglobals][KDE] +widgetStyle=Breeze + +[kwinrc][DesktopSwitcher] +LayoutName=org.kde.breeze.desktop + +[kwinrc][WindowSwitcher] +LayoutName=thumbnail_grid + +[kwinrc][org.kde.kdecoration2] +ButtonsOnLeft=XAI +ButtonsOnRight= +library=org.kde.kwin.aurorae +theme=__aurorae__svg__Utterly-Round-Light-Solid + +[plasmarc][Theme] +name=Utterly-Round-Solid diff --git a/config/plasma/look-and-feel/dotfiles.nord.light/metadata.json b/config/plasma/look-and-feel/dotfiles.nord.light/metadata.json new file mode 100644 index 0000000..d833276 --- /dev/null +++ b/config/plasma/look-and-feel/dotfiles.nord.light/metadata.json @@ -0,0 +1,13 @@ +{ + "KPackageStructure": "Plasma/LookAndFeel", + "KPlugin": { + "Authors": [{ "Name": "dotfiles" }], + "Category": "Global Themes (Plasma 6)", + "Description": "Utterly Nord Light (Solid) with Breeze widgets; leaves the wallpaper alone so slideshows survive day/night switches", + "Id": "dotfiles.nord.light", + "License": "GPL-2.0+", + "Name": "Nord Light (dotfiles)", + "Version": "1.0" + }, + "X-Plasma-APIVersion": "2" +} diff --git a/config/ssh/config b/config/ssh/config new file mode 100644 index 0000000..76ed804 --- /dev/null +++ b/config/ssh/config @@ -0,0 +1,73 @@ +Include ~/.ssh/config.local + +# ETV hosts — mirrors XPipe entry names (ETV category). +# _local = intranet/VPN, _root = root login. Keys: ~/.ssh/id_ed25519 (deck@steamdeck). + +Host * + IdentityFile ~/.ssh/id_ed25519 + IdentitiesOnly yes + ServerAliveInterval 15 + ServerAliveCountMax 3 + ControlMaster auto + ControlPath ~/.ssh/cm-%C + ControlPersist 10m + +# --- Proxmox VE nodes --- +Host fenrir_local + HostName 192.168.129.47 + User ziadarafat +Host fenrir_local_root + HostName 192.168.129.47 + User root +Host r2d2_local_root + HostName 192.168.129.52 + User root +Host gryphus_local_root + HostName 192.168.129.51 + User root +Host spyro_local_root + HostName 192.168.129.53 + User root +# johnserver: SHUTDOWN — do not connect automatically +Host johnserver_root_local + HostName 192.168.129.46 + User root + +# --- VMs --- +Host allmind_local + HostName 192.168.129.13 + User ziadarafat +Host raven_local + HostName 192.168.129.208 + User ziadarafat +Host rusty_local + HostName 192.168.129.16 + User ziadarafat +# ayre: SHUTDOWN +Host ayre_local + HostName 192.168.129.15 + User ziadarafat + +# --- Infrastructure / edge --- +Host etv_local + HostName 192.168.129.38 + User ziadarafat +# NOTE: wireguard.etvamerica.com:8069 actually lands on allmind, NOT the etv rack server (dell-r320) +Host etv + HostName wireguard.etvamerica.com + Port 8069 + User ziadarafat +Host yoda_local + HostName 192.168.129.213 + User ziadarafat +Host claude-ops_local + HostName 192.168.129.214 + User claude + +# --- Home lab (not ETV) --- +Host arceus_local_root + HostName 10.0.0.23 + User root +Host yveltal_local + HostName 10.0.0.38 + User ziadarafat diff --git a/config/vesktop/quickCss.css b/config/vesktop/quickCss.css new file mode 100644 index 0000000..e69de29 diff --git a/config/vesktop/vencord.json b/config/vesktop/vencord.json new file mode 100644 index 0000000..bd71314 --- /dev/null +++ b/config/vesktop/vencord.json @@ -0,0 +1,552 @@ +{ + "autoUpdate": true, + "autoUpdateNotification": true, + "useQuickCss": true, + "themeLinks": [], + "eagerPatches": false, + "enabledThemes": [], + "enableReactDevtools": false, + "frameless": false, + "transparent": false, + "winCtrlQ": false, + "windowsMaterial": "none", + "disableMinSize": false, + "nativeTitleBar": false, + "plugins": { + "ChatInputButtonAPI": { + "enabled": false + }, + "CommandsAPI": { + "enabled": true + }, + "DynamicImageModalAPI": { + "enabled": false + }, + "MemberListDecoratorsAPI": { + "enabled": false + }, + "MessageAccessoriesAPI": { + "enabled": true + }, + "MessageDecorationsAPI": { + "enabled": false + }, + "MessageEventsAPI": { + "enabled": false + }, + "MessagePopoverAPI": { + "enabled": false + }, + "MessageUpdaterAPI": { + "enabled": false + }, + "ServerListAPI": { + "enabled": false + }, + "UserSettingsAPI": { + "enabled": true + }, + "AccountPanelServerProfile": { + "enabled": false + }, + "AddAttachments": { + "enabled": false + }, + "AlwaysAnimate": { + "enabled": false + }, + "AlwaysExpandRoles": { + "enabled": false + }, + "AlwaysTrust": { + "enabled": false + }, + "AnonymiseFileNames": { + "enabled": false + }, + "WebRichPresence (arRPC)": { + "enabled": false + }, + "BetterFolders": { + "enabled": false + }, + "BetterGifAltText": { + "enabled": false + }, + "BetterGifPicker": { + "enabled": false + }, + "BetterRoleContext": { + "enabled": false + }, + "BetterRoleDot": { + "enabled": false + }, + "BetterSessions": { + "enabled": false + }, + "BetterSettings": { + "enabled": false + }, + "BetterUploadButton": { + "enabled": false + }, + "BiggerStreamPreview": { + "enabled": false + }, + "BlurNSFW": { + "enabled": false + }, + "CallTimer": { + "enabled": false + }, + "CharacterCounter": { + "enabled": false + }, + "ClearURLs": { + "enabled": false + }, + "ClientTheme": { + "enabled": false + }, + "ColorSighted": { + "enabled": false + }, + "ConsoleJanitor": { + "enabled": false + }, + "ConsoleShortcuts": { + "enabled": false + }, + "CopyEmojiMarkdown": { + "enabled": false + }, + "CopyFileContents": { + "enabled": false + }, + "CopyStickerLinks": { + "enabled": false + }, + "CopyUserURLs": { + "enabled": false + }, + "CrashHandler": { + "enabled": true + }, + "CustomCommands": { + "enabled": false + }, + "CustomIdle": { + "enabled": false + }, + "CustomRPC": { + "enabled": false + }, + "Dearrow": { + "enabled": false + }, + "Decor": { + "enabled": false + }, + "DirectFileDownload": { + "enabled": false + }, + "DisableCallIdle": { + "enabled": false + }, + "DontRoundMyTimestamps": { + "enabled": false + }, + "Experiments": { + "enabled": false + }, + "ExpressionCloner": { + "enabled": false + }, + "F8Break": { + "enabled": false + }, + "FakeNitro": { + "enabled": false + }, + "FakeProfileThemes": { + "enabled": false + }, + "FavoriteEmojiFirst": { + "enabled": false + }, + "FixCodeblockGap": { + "enabled": false + }, + "FixImagesQuality": { + "enabled": false + }, + "FixSpotifyEmbeds": { + "enabled": false + }, + "FixYoutubeEmbeds": { + "enabled": false + }, + "ForceOwnerCrown": { + "enabled": false + }, + "FriendInvites": { + "enabled": false + }, + "FullSearchContext": { + "enabled": false + }, + "FullUserInChatbox": { + "enabled": false + }, + "GameActivityToggle": { + "enabled": false + }, + "GifPaste": { + "enabled": false + }, + "GifProviderSwitcher": { + "enabled": false + }, + "GreetStickerPicker": { + "enabled": false + }, + "HideMedia": { + "enabled": false + }, + "iLoveSpam": { + "enabled": false + }, + "IgnoreActivities": { + "enabled": false + }, + "ImageFilename": { + "enabled": false + }, + "ImageLink": { + "enabled": false + }, + "ImageZoom": { + "enabled": false + }, + "ImplicitRelationships": { + "enabled": false + }, + "IrcColors": { + "enabled": false + }, + "JumpToTop": { + "enabled": false + }, + "KeepCurrentChannel": { + "enabled": false + }, + "LoadingQuotes": { + "enabled": false + }, + "MemberCount": { + "enabled": false + }, + "MentionAvatars": { + "enabled": false + }, + "MessageClickActions": { + "enabled": false + }, + "MessageLatency": { + "enabled": false + }, + "MessageLinkEmbeds": { + "enabled": false + }, + "MessageLogger": { + "enabled": false + }, + "MoreQuickReactions": { + "enabled": false + }, + "MusicRichPresence": { + "enabled": false + }, + "MutualGroupDMs": { + "enabled": false + }, + "NewGuildSettings": { + "enabled": false + }, + "NoBlockedMessages": { + "enabled": false + }, + "NoDevtoolsWarning": { + "enabled": false + }, + "NoF1": { + "enabled": false + }, + "NoMaskedUrlPaste": { + "enabled": false + }, + "NoMiddleClickPaste": { + "enabled": false + }, + "NoMosaic": { + "enabled": false + }, + "NoOnboardingDelay": { + "enabled": false + }, + "NoPendingCount": { + "enabled": false + }, + "NoProfileThemes": { + "enabled": false + }, + "NoReplyMention": { + "enabled": false + }, + "NoServerEmojis": { + "enabled": false + }, + "NoTypingAnimation": { + "enabled": false + }, + "NoUnblockToJump": { + "enabled": false + }, + "NotificationVolume": { + "enabled": false + }, + "OnePingPerDM": { + "enabled": false + }, + "oneko": { + "enabled": false + }, + "OpenInApp": { + "enabled": false + }, + "OverrideForumDefaults": { + "enabled": false + }, + "PauseInvitesForever": { + "enabled": false + }, + "PermissionFreeWill": { + "enabled": false + }, + "PermissionsViewer": { + "enabled": false + }, + "petpet": { + "enabled": false + }, + "PictureInPicture": { + "enabled": false + }, + "PinDMs": { + "enabled": false + }, + "PlainFolderIcon": { + "enabled": false + }, + "PlatformIndicators": { + "enabled": false + }, + "PreviewMessage": { + "enabled": false + }, + "QuickMention": { + "enabled": false + }, + "QuickReply": { + "enabled": false + }, + "ReactErrorDecoder": { + "enabled": false + }, + "ReadAllNotificationsButton": { + "enabled": false + }, + "RelationshipNotifier": { + "enabled": false + }, + "ReplaceGoogleSearch": { + "enabled": false + }, + "ReplyTimestamp": { + "enabled": false + }, + "RevealAllSpoilers": { + "enabled": false + }, + "ReverseImageSearch": { + "enabled": false + }, + "ReviewDB": { + "enabled": false + }, + "RoleColorEverywhere": { + "enabled": false + }, + "SecretRingToneEnabler": { + "enabled": false + }, + "SendTimestamps": { + "enabled": false + }, + "ServerInfo": { + "enabled": false + }, + "ServerListIndicators": { + "enabled": false + }, + "ShikiCodeblocks": { + "enabled": false + }, + "ShowAllMessageButtons": { + "enabled": false + }, + "ShowConnections": { + "enabled": false + }, + "ShowHiddenChannels": { + "enabled": false + }, + "ShowHiddenThings": { + "enabled": false + }, + "ShowMeYourName": { + "enabled": false + }, + "ShowTimeoutDuration": { + "enabled": false + }, + "SilentMessageToggle": { + "enabled": false + }, + "SilentTyping": { + "enabled": false + }, + "SortFriendRequests": { + "enabled": false + }, + "SpotifyControls": { + "enabled": false + }, + "SpotifyCrack": { + "enabled": false + }, + "SpotifyShareCommands": { + "enabled": false + }, + "StartupTimings": { + "enabled": false + }, + "StickerPaste": { + "enabled": false + }, + "StreamerModeOnStream": { + "enabled": false + }, + "SuperReactionTweaks": { + "enabled": false + }, + "TextReplace": { + "enabled": false + }, + "ThemeAttributes": { + "enabled": false + }, + "Translate": { + "enabled": false + }, + "TypingIndicator": { + "enabled": false + }, + "TypingTweaks": { + "enabled": false + }, + "Unindent": { + "enabled": false + }, + "UnlockedAvatarZoom": { + "enabled": false + }, + "UnsuppressEmbeds": { + "enabled": false + }, + "UserMessagesPronouns": { + "enabled": false + }, + "UserVoiceShow": { + "enabled": false + }, + "USRBG": { + "enabled": false + }, + "ValidReply": { + "enabled": false + }, + "ValidUser": { + "enabled": false + }, + "VoiceChatDoubleClick": { + "enabled": false + }, + "VcNarrator": { + "enabled": false + }, + "VencordToolbox": { + "enabled": false + }, + "ViewIcons": { + "enabled": false + }, + "ViewRaw": { + "enabled": false + }, + "VoiceDownload": { + "enabled": false + }, + "VoiceMessages": { + "enabled": false + }, + "VolumeBooster": { + "enabled": false + }, + "WebKeybinds": { + "enabled": true + }, + "WebScreenShareFixes": { + "enabled": true + }, + "WhoReacted": { + "enabled": false + }, + "XSOverlay": { + "enabled": false + }, + "YoutubeAdblock": { + "enabled": false + }, + "BadgeAPI": { + "enabled": true + } + }, + "uiElements": { + "chatBarButtons": {}, + "messagePopoverButtons": {} + }, + "notifications": { + "timeout": 5000, + "position": "bottom-right", + "useNative": "not-focused", + "logLimit": 50 + }, + "cloud": { + "authenticated": false, + "url": "https://api.vencord.dev/", + "settingsSync": false, + "settingsSyncVersion": 1792806402013 + } +} \ No newline at end of file diff --git a/config/vesktop/vesktop.json b/config/vesktop/vesktop.json new file mode 100644 index 0000000..c73d664 --- /dev/null +++ b/config/vesktop/vesktop.json @@ -0,0 +1,31 @@ +{ + "discordBranch": "canary", + "hardwareAcceleration": true, + "hardwareVideoAcceleration": false, + "nativeTitleBar": false, + "staticTitle": false, + "enableMenu": false, + "enableShadow": true, + "enableRoundedCorners": true, + "enableSplashScreen": true, + "splashTheming": true, + "tray": true, + "minimizeToTray": true, + "clickTrayToShowHide": false, + "disableMinSize": false, + "disableSmoothScroll": false, + "enableTaskbarFlashing": false, + "arRPC": true, + "openLinksWithElectron": false, + "autoStartMinimized": false, + "splashPixelated": false, + "webRTCIPHandlingPolicy": "default", + "appBadge": true, + "transparencyOption": "none", + "spellCheckLanguages": [ + "en-US", + "en" + ], + "splashColor": "rgb(243, 243, 244)", + "splashBackground": "rgb(44, 45, 50)" +} \ No newline at end of file diff --git a/config/vscodium/settings.json b/config/vscodium/settings.json new file mode 100644 index 0000000..d47ab15 --- /dev/null +++ b/config/vscodium/settings.json @@ -0,0 +1,3 @@ +{ + "git.openRepositoryInParentFolders": "never" +} \ No newline at end of file diff --git a/config/xpipe/preferences.json b/config/xpipe/preferences.json new file mode 100644 index 0000000..0b381ff --- /dev/null +++ b/config/xpipe/preferences.json @@ -0,0 +1,12 @@ +{ + "enableGitStorage": true, + "storageGitRemote": "https://github.com/RustyRaptor/xpipe-sync.git", + "gitUsername": "RustyRaptor", + "terminalType": "app.konsole", + "preferTerminalTabs": true, + "terminalMultiplexer": { "type": "tmux" }, + "clearTerminalOnInit": true, + "terminalAlwaysPauseOnExit": true, + "enableFileBrowserTerminalDocking": true, + "enableConnectionHubTerminalDocking": true +} diff --git a/config/zed/settings.json b/config/zed/settings.json new file mode 100644 index 0000000..537584b --- /dev/null +++ b/config/zed/settings.json @@ -0,0 +1,11 @@ +{ + "theme": { "mode": "system", "light": "One Light", "dark": "One Dark" }, + "ui_font_size": 16, + "buffer_font_size": 14, + "buffer_font_family": "Hack Nerd Font Mono", + "terminal": { "shell": { "program": "zsh" } }, + "telemetry": { "diagnostics": false, "metrics": false }, + "languages": { + "Python": { "language_servers": ["ruff", "pyright", "!pylsp"] } + } +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..da40c09 --- /dev/null +++ b/flake.lock @@ -0,0 +1,89 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1793193205, + "narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "konsole-daynight": { + "flake": false, + "locked": { + "lastModified": 1768163785, + "narHash": "sha256-IpQJe9XHE9QCp1hYr9O58Z0FQOWypCpwZOryZZAMEnY=", + "owner": "RustyRaptor", + "repo": "konsole_daynight", + "rev": "7c34a4c50176d7fb807839972f445daea9201012", + "type": "github" + }, + "original": { + "owner": "RustyRaptor", + "repo": "konsole_daynight", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1793225069, + "narHash": "sha256-sx1f99WGrDfJ83KKuQrqGPmot0rnDgmpLJDzpU2oHQQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e62746b0b472753ef019baceab6f1e2e52014980", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1785762349, + "narHash": "sha256-jZhZkzAwc7f3exzcTDJWP2WCAchCv0iNC3UF/QsahdQ=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "a19a2a029fa180911bd89c554dca1616e10f4c1d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "konsole-daynight": "konsole-daynight", + "nixpkgs": "nixpkgs", + "plasma-manager": "plasma-manager" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c80e814 --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + description = "Ziad's portable dev environment (SteamOS, Fedora KDE, Arch, CachyOS)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + konsole-daynight = { + url = "github:RustyRaptor/konsole_daynight"; + flake = false; + }; + }; + + outputs = + { + nixpkgs, + home-manager, + plasma-manager, + ... + }@inputs: + let + # Username, home and repo location are read from the environment, so every + # switch runs with --impure (bin/dot does this). That keeps one flake usable + # as `deck` on SteamOS, `abc` in a webtop and `ziadarafat` on servers. + env = name: fallback: let v = builtins.getEnv name; in if v == "" then fallback else v; + username = env "USER" "deck"; + homeDirectory = env "HOME" "/home/${username}"; + dotfilesDir = env "DOTFILES_DIR" "${homeDirectory}/.dotfiles"; + + osRelease = + let + f = /etc/os-release; + lines = if builtins.pathExists f then nixpkgs.lib.splitString "\n" (builtins.readFile f) else [ ]; + idLine = nixpkgs.lib.findFirst (l: nixpkgs.lib.hasPrefix "ID=" l) "ID=unknown" lines; + in + nixpkgs.lib.removePrefix "ID=" (builtins.replaceStrings [ "\"" ] [ "" ] idLine); + + mkHome = + { system, gui }: + home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + extraSpecialArgs = { inherit inputs osRelease; }; + modules = [ + plasma-manager.homeModules.plasma-manager + ./home + { + home = { inherit username homeDirectory; }; + dotfiles = { inherit gui; dir = dotfilesDir; }; + } + ]; + }; + in + { + homeConfigurations = { + full = mkHome { system = "x86_64-linux"; gui = true; }; + headless = mkHome { system = "x86_64-linux"; gui = false; }; + headless-aarch64 = mkHome { system = "aarch64-linux"; gui = false; }; + }; + }; +} diff --git a/home/agents.nix b/home/agents.nix new file mode 100644 index 0000000..f401ac9 --- /dev/null +++ b/home/agents.nix @@ -0,0 +1,15 @@ +{ config, ... }: +let + link = config.dotfiles.link; +in +{ + # Claude Code and pi install themselves (`dot apps`) so their auto-updaters keep working. + # Config is linked from the checkout so in-app edits show up in `git diff`. + home.file = { + ".claude/settings.json".source = link "config/claude/settings.json"; + ".claude/CLAUDE.md".source = link "config/claude/CLAUDE.md"; + ".pi/agent/settings.json".source = link "config/pi/settings.json"; + }; + # MCP servers carry tokens, so they are rendered from config/*/mcp*.json templates + # plus ~/.config/dotfiles/secrets.env by `dot secrets render` (never committed). +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..dd6ef51 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, osRelease, ... }: +let + cfg = config.dotfiles; +in +{ + imports = [ + ./shell.nix + ./git.nix + ./dev.nix + ./ssh.nix + ./agents.nix + ./gui + ]; + + options.dotfiles = { + gui = lib.mkEnableOption "GUI layer (KDE Plasma, Flatpaks, Konsole, themes)"; + dir = lib.mkOption { + type = lib.types.str; + description = "Absolute path of the dotfiles checkout; used for writable out-of-store links."; + }; + os = lib.mkOption { + type = lib.types.str; + default = osRelease; + description = "ID= from /etc/os-release at switch time (steamos, fedora, arch, cachyos, ...)."; + }; + # Link a file from the checkout instead of the Nix store, so apps that write + # their own config (Claude, Vesktop, Konsole) can, and the change shows up in git. + link = lib.mkOption { + type = lib.types.functionTo lib.types.anything; + readOnly = true; + default = rel: config.lib.file.mkOutOfStoreSymlink "${cfg.dir}/${rel}"; + }; + }; + + config = { + home.stateVersion = "25.11"; + programs.home-manager.enable = true; + targets.genericLinux.enable = true; + news.display = "silent"; + + nix = { + package = lib.mkDefault pkgs.nix; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + + home.sessionPath = [ "$HOME/.local/bin" "${cfg.dir}/bin" ]; + home.sessionVariables = { + DOTFILES_DIR = cfg.dir; + EDITOR = "nano"; + }; + + xdg.enable = true; + }; +} diff --git a/home/dev.nix b/home/dev.nix new file mode 100644 index 0000000..fe9de7c --- /dev/null +++ b/home/dev.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: +{ + home.packages = with pkgs; [ + # everyday CLI + curl wget jq yq-go ripgrep fd tree unzip zip file which rsync tmux + nmap rclone gnupg + # forges and secrets + tea gh bitwarden-cli gitea-mcp-server + # VPN client; `dot system` installs its root daemon unit + netbird + # nix tooling + nixfmt nil + ]; + + # mise owns language runtimes and npm/GitHub-released CLIs. + programs.mise = { + enable = true; + enableZshIntegration = true; + enableBashIntegration = true; + globalConfig = { + tools = { + node = "24"; + uv = "latest"; + python = "3.13"; + go = "latest"; + deno = "latest"; + java = "latest"; + "npm:@earendil-works/pi-coding-agent" = "latest"; + "github:scottmckendry/pokemon-go-colorscripts" = "latest"; + }; + settings = { + experimental = true; + # Avoid GitHub API rate limits in fresh containers. + github_attestations = false; + idiomatic_version_file_enable_tools = [ "python" "node" ]; + }; + }; + }; + + # Rootful bits (podman, distrobox) come from the distro; distrobox.ini declares the boxes. + xdg.configFile."distrobox/distrobox.ini".source = ../config/distrobox/distrobox.ini; +} diff --git a/home/files/pokefetch.zsh b/home/files/pokefetch.zsh new file mode 100644 index 0000000..1d964e9 --- /dev/null +++ b/home/files/pokefetch.zsh @@ -0,0 +1,35 @@ +# fastfetch with a Pokémon sprite as the logo. +# Override in ~/.config/dotfiles/local.zsh: +# POKEMON=pikachu # any name from `pokemon-go-colorscripts --list` +# POKEMON_FORM=fan # explicit form; Rotom otherwise picks one per distro +# POKEMON_SHINY_PERCENT=10 # 0-100 +# POKEFETCH=0 # disable +pokefetch() { + [[ "${POKEFETCH:-1}" == 0 ]] && return + command -v fastfetch >/dev/null || return + local mon="${POKEMON:-rotom}" form="${POKEMON_FORM:-}" os_id=unknown + [[ -r /etc/os-release ]] && os_id=$(. /etc/os-release && echo "$ID") + + if [[ -z "$form" && "$mon" == rotom ]]; then + case "$os_id" in + steamos) form="" ;; # regular Rotom on the Deck + fedora) form=fan ;; + debian|ubuntu) form=wash ;; + almalinux|rhel|rocky) form=frost ;; + arch|cachyos) form=heat ;; + *) form=mow ;; + esac + fi + + local -a args=(--no-title -n "$mon") + [[ -n "$form" ]] && args+=(-f "$form") + (( RANDOM % 100 < ${POKEMON_SHINY_PERCENT:-10} )) && args+=(-s) + + if command -v pokemon-go-colorscripts >/dev/null; then + fastfetch --data "$(pokemon-go-colorscripts "${args[@]}" 2>/dev/null)" + else + fastfetch + fi +} + +[[ -o interactive && -z "$INSIDE_EMACS" && "$TERM" != dumb ]] && pokefetch diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..741df55 --- /dev/null +++ b/home/git.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + programs.git = { + enable = true; + settings = { + user = { + name = "Ziad Arafat"; + email = "anonymous0programmer@gmail.com"; + }; + init.defaultBranch = "main"; + # Tokens for HTTPS remotes land in ~/.git-credentials via `dot secrets pull`. + credential.helper = "store"; + http = { + lowSpeedLimit = 1000; + lowSpeedTime = 60; + postBuffer = 524288000; + }; + safe.directory = "*"; + }; + ignores = [ ".direnv/" ".envrc.local" "*.swp" ".venv/" "__pycache__/" ]; + }; + programs.git.lfs.enable = true; +} diff --git a/home/gui/apps.nix b/home/gui/apps.nix new file mode 100644 index 0000000..fad9a81 --- /dev/null +++ b/home/gui/apps.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: +let + link = config.dotfiles.link; + vesktop = ".var/app/dev.vencord.Vesktop/config/vesktop"; +in +lib.mkIf config.dotfiles.gui { + # GUI apps are Flatpaks (config/flatpaks.txt, installed by `dot apps`); + # these are the few that work better outside the sandbox. + home.packages = [ pkgs.xpipe ]; + + # Let the host's Plasma session see Nix-installed .desktop files and icons. + xdg.configFile."plasma-workspace/env/10-nix.sh".text = '' + export XDG_DATA_DIRS="$HOME/.nix-profile/share:''${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + ''; + xdg.configFile."environment.d/10-nix.conf".text = '' + XDG_DATA_DIRS=$HOME/.nix-profile/share:''${XDG_DATA_DIRS:-/usr/local/share:/usr/share} + ''; + + home.file = { + "${vesktop}/settings.json".source = link "config/vesktop/vesktop.json"; + "${vesktop}/settings/settings.json".source = link "config/vesktop/vencord.json"; + "${vesktop}/settings/quickCss.css".source = link "config/vesktop/quickCss.css"; + ".config/VSCodium/User/settings.json".source = link "config/vscodium/settings.json"; + ".config/zed/settings.json".source = link "config/zed/settings.json"; + }; +} diff --git a/home/gui/daynight.nix b/home/gui/daynight.nix new file mode 100644 index 0000000..c34c66d --- /dev/null +++ b/home/gui/daynight.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, inputs, ... }: +let + py = pkgs.python3.withPackages (ps: with ps; [ pygobject3 pydbus loguru click pillow ]); + giEnv = '' + export GI_TYPELIB_PATH=${pkgs.glib.out}/lib/girepository-1.0''${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH} + ''; + + # RustyRaptor/konsole_daynight, run straight from source with Nix-provided + # PyGObject (pip can't build it on SteamOS: no compiler). + konsole-daynight = pkgs.writeShellScriptBin "konsole-daynight" '' + ${giEnv} + export PYTHONPATH=${inputs.konsole-daynight}/src + exec ${py}/bin/python -m konsole_daynight.cli "$@" + ''; + daynight-hooks = pkgs.writeShellScriptBin "daynight-hooks" '' + ${giEnv} + exec ${py}/bin/python ${../../scripts/daynight-hooks.py} "$@" + ''; + wallpaper-sort = pkgs.writeShellScriptBin "wallpaper-sort" '' + exec ${py}/bin/python ${../../scripts/wallpaper-sort.py} "$@" + ''; + + wallpapers = "${config.home.homeDirectory}/Pictures/Wallpapers"; + + userService = description: exec: { + Unit = { + Description = description; + After = [ "graphical-session.target" "plasma-plasmashell.service" ]; + PartOf = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = exec; + Restart = "on-failure"; + RestartSec = 5; + # The host's KDE tools (kwriteconfig6, qdbus6) live in /usr/bin. + Environment = "PATH=/usr/bin:/bin:${config.home.profileDirectory}/bin"; + }; + Install.WantedBy = [ "graphical-session.target" ]; + }; +in +lib.mkIf config.dotfiles.gui { + home.packages = [ konsole-daynight daynight-hooks wallpaper-sort ]; + + xdg.configFile."dotfiles/activities.json".text = builtins.toJSON { + # First entry takes over the stock "Default" activity. + activities = { + Personal = { wallpapers = "${wallpapers}/personal"; interval = 10; }; + Work = { wallpapers = "${wallpapers}/work"; interval = 900; }; + }; + konsole = { light = "Light"; dark = "Dark"; }; + }; + + systemd.user.services = { + konsole-daynight = userService "Konsole profile follows Plasma light/dark" "${konsole-daynight}/bin/konsole-daynight --light_profile Light --dark_profile Dark"; + daynight-hooks = userService "Activities + light/dark wallpaper folders follow Plasma" "${daynight-hooks}/bin/daynight-hooks"; + }; +} diff --git a/home/gui/default.nix b/home/gui/default.nix new file mode 100644 index 0000000..8ff6b28 --- /dev/null +++ b/home/gui/default.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: +{ + imports = [ + ./themes.nix + ./kde.nix + ./konsole.nix + ./daynight.nix + ./apps.nix + ]; + # Every module above wraps its config in `lib.mkIf config.dotfiles.gui`. +} diff --git a/home/gui/kde.nix b/home/gui/kde.nix new file mode 100644 index 0000000..da22c9d --- /dev/null +++ b/home/gui/kde.nix @@ -0,0 +1,138 @@ +{ config, lib, pkgs, ... }: +let + monitor = title: face: sensorIds: extra: { + systemMonitor = { + inherit title; + showTitle = false; + displayStyle = face; + settings = lib.recursiveUpdate { + # ksystemstats accepts regexes in sensor ids, so per-core / per-disk + # charts adapt to whatever machine this lands on. + Sensors.highPrioritySensorIds = "[${lib.concatMapStringsSep ", " (s: ''"${s}"'') sensorIds}]"; + } extra; + }; + }; +in +lib.mkIf config.dotfiles.gui { + xdg.dataFile = { + "plasma/look-and-feel/dotfiles.nord.light".source = ../../config/plasma/look-and-feel/dotfiles.nord.light; + "plasma/look-and-feel/dotfiles.nord.dark".source = ../../config/plasma/look-and-feel/dotfiles.nord.dark; + }; + + programs.plasma = { + enable = true; + + workspace.clickItemTo = "select"; + + panels = [ + { + location = "bottom"; + floating = true; + height = 50; + lengthMode = "fit"; + widgets = [ + { + kickoff.icon = if config.dotfiles.os == "steamos" then "distributor-logo-steamdeck" else "start-here-kde-symbolic"; + } + "org.kde.plasma.pager" + "org.kde.plasma.icontasks" + "org.kde.plasma.marginsseparator" + # Per-core CPU usage, vertical colored bars. + (monitor "CPU" "org.kde.ksysguard.barchart" [ "cpu/cpu\\d+/usage" ] { + "org.kde.ksysguard.barchart/General" = { + rangeAuto = false; + rangeFrom = 0; + rangeTo = 100; + showGridLines = false; + }; + }) + # Disk usage per partition, horizontal bars. + (monitor "Disks" "org.kde.ksysguard.horizontalbars" [ "disk/(?!all).*/usedPercent" ] { + "org.kde.ksysguard.horizontalbars/General" = { + rangeAuto = false; + rangeFrom = 0; + rangeTo = 100; + }; + }) + # Network throughput, line graph. + (monitor "Network" "org.kde.ksysguard.linechart" [ "network/all/download" "network/all/upload" ] { + "org.kde.ksysguard.linechart/General" = { + showGridLines = false; + historyAmount = 60; + }; + }) + # RAM as a ring with the percentage in the middle. + (monitor "Memory" "org.kde.ksysguard.piechart" [ "memory/physical/used" ] { + Sensors.totalSensors = ''["memory/physical/usedPercent"]''; + "org.kde.ksysguard.piechart/General" = { + showLegend = false; + rangeAuto = true; + }; + }) + { + systemTray.items = { + shown = [ + "aurynk-indicator" + "org.kde.plasma.volume" + "org.kde.plasma.bluetooth" + "org.kde.plasma.brightness" + "org.kde.plasma.networkmanagement" + "org.kde.plasma.battery" + "org.kde.plasma.clipboard" + "org.kde.plasma.notifications" + "org.kde.plasma.weather" + ]; + hidden = [ + "steam" + "org.kde.plasma.diskquota" + "org.kde.plasma.trash" + "org.kde.plasma.addons.katesessions" + ]; + }; + } + { + digitalClock = { + timeZone = { + selected = [ + "Local" + "America/Phoenix" # Arizona: no DST + "America/Los_Angeles" + "America/Chicago" + "America/New_York" + "Europe/London" + "Asia/Shanghai" # Beijing + ]; + lastSelected = "Local"; + changeOnScroll = true; + }; + }; + } + "org.kde.plasma.showdesktop" + ]; + } + ]; + + configFile = { + kdeglobals = { + # Plasma 6.5+ switches global themes on the knighttime day/night schedule. + KDE = { + AutomaticLookAndFeel = true; + DefaultLightLookAndFeel = "dotfiles.nord.light"; + DefaultDarkLookAndFeel = "dotfiles.nord.dark"; + }; + # Accent colour follows the current wallpaper, so each slideshow change re-tints the UI. + General.accentColorFromWallpaper = true; + }; + # Night Light's default mode (DarkLight) follows the same schedule. + kwinrc.NightColor = { + Active = true; + NightTemperature = 3700; + }; + knighttimerc.Location = { + Automatic = false; + Latitude = 35.792282919847324; + Longitude = -102.4421405075188; + }; + }; + }; +} diff --git a/home/gui/konsole.nix b/home/gui/konsole.nix new file mode 100644 index 0000000..beb899f --- /dev/null +++ b/home/gui/konsole.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: +let + link = config.dotfiles.link; + profiles = [ "Light" "Dark" "general" "etv" ]; +in +lib.mkIf config.dotfiles.gui { + # Light = Solarized Light, Dark = Breeze. konsole-daynight flips between them; + # `general`/`etv` open the distroboxes. + xdg.dataFile = lib.listToAttrs (map (p: lib.nameValuePair "konsole/${p}.profile" { source = link "config/konsole/${p}.profile"; }) profiles); + + programs.plasma.configFile.konsolerc = { + KonsoleWindow.ForceNewTabs = true; + }; +} diff --git a/home/gui/themes.nix b/home/gui/themes.nix new file mode 100644 index 0000000..0934413 --- /dev/null +++ b/home/gui/themes.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: +let + # The host's Plasma doesn't look in ~/.nix-profile/share, so link theme + # payloads into ~/.local/share where it does. + tela = pkgs.tela-circle-icon-theme.override { colorVariants = [ "nord" ]; }; + share = pkg: sub: "${pkg}/share/${sub}"; +in +lib.mkIf config.dotfiles.gui { + xdg.dataFile = { + "plasma/look-and-feel/Utterly-Nord-Solid".source = share pkgs.utterly-nord-plasma "plasma/look-and-feel/Utterly-Nord-Solid"; + "plasma/look-and-feel/Utterly-Nord-Light-Solid".source = share pkgs.utterly-nord-plasma "plasma/look-and-feel/Utterly-Nord-Light-Solid"; + "color-schemes/UtterlyNord.colors".source = share pkgs.utterly-nord-plasma "color-schemes/UtterlyNord.colors"; + "color-schemes/UtterlyNordLight.colors".source = share pkgs.utterly-nord-plasma "color-schemes/UtterlyNordLight.colors"; + "plasma/desktoptheme/Utterly-Round-Solid".source = share pkgs.utterly-round-plasma-style "plasma/desktoptheme/Utterly-Round-Solid"; + "aurorae/themes/Utterly-Round-Light-Solid".source = share pkgs.utterly-round-plasma-style "aurorae/themes/Utterly-Round-Light-Solid"; + "aurorae/themes/Utterly-Round-Dark-Solid".source = share pkgs.utterly-round-plasma-style "aurorae/themes/Utterly-Round-Dark-Solid"; + "icons/Tela-circle-nord".source = share tela "icons/Tela-circle-nord"; + "icons/Tela-circle-nord-dark".source = share tela "icons/Tela-circle-nord-dark"; + "icons/Tela-circle-nord-light".source = share tela "icons/Tela-circle-nord-light"; + "icons/Nordic-cursors".source = share pkgs.nordic "icons/Nordic-cursors"; + }; + + home.packages = [ pkgs.nerd-fonts.hack ]; + fonts.fontconfig.enable = true; +} diff --git a/home/shell.nix b/home/shell.nix new file mode 100644 index 0000000..03eae43 --- /dev/null +++ b/home/shell.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: +{ + home.packages = [ pkgs.fastfetch ]; + + programs.zsh = { + enable = true; + dotDir = config.home.homeDirectory; + # The login shell stays the distro's zsh (/usr/bin/zsh); it reads these files. + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + history = { + size = 50000; + save = 50000; + share = true; + ignoreDups = true; + }; + oh-my-zsh = { + enable = true; + theme = "xiong-chiamiov-plus"; + plugins = [ "git" "virtualenv" ] ++ lib.optional (lib.elem config.dotfiles.os [ "arch" "cachyos" "steamos" ]) "archlinux"; + }; + + envExtra = '' + # Nix itself: single-user installs (SteamOS, containers) and multi-user daemons. + if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then + . "$HOME/.nix-profile/etc/profile.d/nix.sh" + elif [ -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then + . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh + fi + export MISE_EXPERIMENTAL=1 + ''; + + initContent = lib.mkMerge [ + (lib.mkOrder 550 '' + # Machine-local overrides (not in git): POKEMON, POKEMON_SHINY_PERCENT, aliases... + [ -f "$HOME/.config/dotfiles/local.zsh" ] && source "$HOME/.config/dotfiles/local.zsh" + '') + '' + source ${./files/pokefetch.zsh} + '' + ]; + }; + + programs.bash = { + enable = true; + # Hand interactive bash sessions to zsh where chsh isn't possible (e.g. webtops). + initExtra = '' + if [ -z "$DOTFILES_NO_ZSH" ] && [ -z "$ZSH_VERSION" ] && command -v zsh >/dev/null && [[ $- == *i* ]] && [ "$SHLVL" -le 2 ]; then + exec zsh -l + fi + ''; + }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.btop.enable = true; + programs.fzf.enable = true; +} diff --git a/home/ssh.nix b/home/ssh.nix new file mode 100644 index 0000000..986ef8a --- /dev/null +++ b/home/ssh.nix @@ -0,0 +1,6 @@ +{ config, ... }: +{ + # Keys come from Bitwarden (`dot secrets pull`); hosts are versioned here. + # Machine-only hosts go in ~/.ssh/config.local, which is included first. + home.file.".ssh/config".source = config.dotfiles.link "config/ssh/config"; +} diff --git a/scripts/daynight-hooks.py b/scripts/daynight-hooks.py new file mode 100644 index 0000000..ab1d32d --- /dev/null +++ b/scripts/daynight-hooks.py @@ -0,0 +1,123 @@ +"""Follow Plasma's light/dark switch. + +On start and on every xdg-portal colour-scheme change: + * points each activity's slideshow at the matching light/ or dark/ wallpaper folder + * sets Konsole's default profile (konsole-daynight only reacts to changes, not boot) + +Activities and folders come from ~/.config/dotfiles/activities.json (written by home-manager). +""" + +import json +import os +import subprocess +import sys +from pathlib import Path + +from gi.repository import GLib +from pydbus import SessionBus + +CONFIG = Path.home() / ".config/dotfiles/activities.json" + + +def current_scheme(bus) -> str: + portal = bus.get("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop") + try: + value = portal.ReadOne("org.freedesktop.appearance", "color-scheme") + except Exception: + value = portal.Read("org.freedesktop.appearance", "color-scheme") + # 1 = prefer dark, 2 = prefer light, 0 = no preference (treat as light) + return "dark" if int(value) == 1 else "light" + + +def plasma_script(js: str) -> None: + for qdbus in ("qdbus6", "qdbus"): + try: + subprocess.run( + [qdbus, "org.kde.plasmashell", "/PlasmaShell", "org.kde.PlasmaShell.evaluateScript", js], + check=True, + capture_output=True, + ) + return + except FileNotFoundError: + continue + + +def apply(scheme: str) -> None: + cfg = json.loads(CONFIG.read_text()) + activities = [] + for name, a in cfg["activities"].items(): + folder = Path(os.path.expanduser(a["wallpapers"])) + sub = folder / scheme + # Fall back to the whole folder until `dot wallpapers` has sorted it. + paths = [str(sub)] if sub.is_dir() and any(sub.iterdir()) else [str(folder)] + activities.append({"name": name, "paths": paths, "interval": a["interval"]}) + + js = """ +const wanted = %s; +for (const id of activities()) { + const name = activityName(id); + const w = wanted.find(x => x.name === name); + if (!w) continue; + for (const d of desktopsForActivity(id)) { + d.wallpaperPlugin = "org.kde.slideshow"; + d.currentConfigGroup = ["Wallpaper", "org.kde.slideshow", "General"]; + d.writeConfig("SlidePaths", w.paths); + d.writeConfig("SlideInterval", w.interval); + d.writeConfig("SlideshowMode", "Random"); + d.writeConfig("FillMode", 2); + d.reloadConfig(); + } +} +""" % json.dumps(activities) + plasma_script(js) + + profile = cfg.get("konsole", {}).get(scheme) + if profile: + subprocess.run( + ["kwriteconfig6", "--file", "konsolerc", "--group", "Desktop Entry", "--key", "DefaultProfile", f"{profile}.profile"], + check=False, + ) + print(f"applied {scheme}", flush=True) + + +def ensure_activities(bus) -> None: + """Create the configured activities; the stock "Default" one becomes the first.""" + names = list(json.loads(CONFIG.read_text())["activities"]) + am = bus.get("org.kde.ActivityManager", "/ActivityManager/Activities") + existing = {am.ActivityName(i): i for i in am.ListActivities()} + for name in names: + if name in existing: + continue + if "Default" in existing and names[0] == name: + am.SetActivityName(existing.pop("Default"), name) + else: + am.AddActivity(name) + + +def main() -> None: + bus = SessionBus() + try: + ensure_activities(bus) + except Exception as exc: # activity manager may not be up yet on a cold login + print(f"activities: {exc}", flush=True) + last = current_scheme(bus) + apply(last) + if "--once" in sys.argv: + return + + portal = bus.get("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop") + + def changed(namespace, key, value): + nonlocal last + if namespace == "org.freedesktop.appearance" and key == "color-scheme": + scheme = "dark" if int(value) == 1 else "light" + if scheme != last: + last = scheme + apply(scheme) + + portal.SettingChanged.connect(changed) + GLib.MainLoop().run() + + +if __name__ == "__main__": + main() diff --git a/scripts/wallpaper-sort.py b/scripts/wallpaper-sort.py new file mode 100644 index 0000000..1d6898c --- /dev/null +++ b/scripts/wallpaper-sort.py @@ -0,0 +1,69 @@ +"""Split a wallpaper folder into light/ and dark/ by perceived brightness. + + wallpaper-sort SRC DEST [--threshold 0.45] + +Copies every image in SRC into DEST/light or DEST/dark (hard-linking when on the +same filesystem). Brightness is the mean Rec. 709 luma of a 64x64 thumbnail; the +threshold is a 0-1 cut-off. Re-running only adds new files and moves any whose +bucket changed, so it is safe to point at a growing folder. +""" + +import argparse +import os +import shutil +from pathlib import Path + +from PIL import Image, ImageStat + +EXTS = {".jpg", ".jpeg", ".png", ".webp", ".bmp", ".gif", ".avif"} + + +def luma(path: Path) -> float: + with Image.open(path) as im: + im.seek(0) + im = im.convert("RGB") + im.thumbnail((64, 64)) + r, g, b = ImageStat.Stat(im).mean + return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255 + + +def place(src: Path, dst: Path) -> None: + if dst.exists(): + return + try: + os.link(src, dst) + except OSError: + shutil.copy2(src, dst) + + +def main() -> None: + ap = argparse.ArgumentParser() + ap.add_argument("src", type=Path) + ap.add_argument("dest", type=Path) + ap.add_argument("--threshold", type=float, default=0.45) + args = ap.parse_args() + + light, dark = args.dest / "light", args.dest / "dark" + light.mkdir(parents=True, exist_ok=True) + dark.mkdir(parents=True, exist_ok=True) + + counts = {"light": 0, "dark": 0, "skipped": 0} + for f in sorted(args.src.iterdir()): + if f.suffix.lower() not in EXTS or not f.is_file(): + continue + try: + value = luma(f) + except Exception as exc: + print(f"skip {f.name}: {exc}") + counts["skipped"] += 1 + continue + bucket, other = (light, dark) if value >= args.threshold else (dark, light) + (other / f.name).unlink(missing_ok=True) + place(f, bucket / f.name) + counts[bucket.name] += 1 + print(f"{bucket.name:5} {value:.2f} {f.name}") + print(f"{args.dest}: {counts}") + + +if __name__ == "__main__": + main()