···
${pkgs.gum}/bin/gum style --foreground 35 "✓ Default push remote is origin"
+
assh = pkgs.writeShellScriptBin "assh" ''
+
if [[ -z "$host" || -z "$port" ]]; then
+
${pkgs.gum}/bin/gum style --foreground 196 "Usage: assh <host> <port>"
+
${pkgs.gum}/bin/gum style --foreground 212 "Connecting to $host:$port (auto-reconnect enabled)..."
+
${pkgs.openssh}/bin/ssh -p "$port" -o "BatchMode yes" "$host" || {
+
${pkgs.gum}/bin/gum style --foreground 214 "Connection lost. Reconnecting in 1s..."
+
hackatime-summary = pkgs.writeShellScriptBin "hackatime-summary" ''
+
if [[ -z "$user_id" ]]; then
+
user_id=$(${pkgs.gum}/bin/gum input --placeholder "Enter user ID" --prompt "User ID: ")
+
if [[ -z "$user_id" ]]; then
+
${pkgs.gum}/bin/gum style --foreground 196 "No user ID provided"
+
${pkgs.gum}/bin/gum spin --spinner dot --title "Fetching Hackatime summary for $user_id..." -- \
+
${pkgs.curl}/bin/curl -s -X 'GET' \
+
"https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \
+
-H 'accept: application/json' \
+
-H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' \
+
> /tmp/hackatime-$$.json
+
${pkgs.jq}/bin/jq '. + {
+
"total_categories_sum": (.categories | map(.total) | add),
+
"total_categories_human_readable": (
+
(.categories | map(.total) | add) as $total_seconds |
+
"\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s"
+
.projects | sort_by(-.total) | map(.key)
+
}' /tmp/hackatime-$$.json
+
rm -f /tmp/hackatime-$$.json
+
now = pkgs.writeShellScriptBin "now" ''
+
# Post AtProto status updates
+
while [[ $# -gt 0 ]]; do
+
${pkgs.gum}/bin/gum style --foreground 196 "Usage: now [-m|--message \"your message\"]"
+
# Load account information from agenix secrets
+
if [[ -f "/run/agenix/bluesky" ]]; then
+
source "/run/agenix/bluesky"
+
${pkgs.gum}/bin/gum style --foreground 196 "Error: Bluesky credentials file not found at /run/agenix/bluesky"
+
# Prompt for message if none provided
+
if [[ "$prompt_message" = true ]]; then
+
message=$(${pkgs.gum}/bin/gum input --placeholder "What's happening?" --prompt "$ACCOUNT1 is: ")
+
if [[ -z "$message" ]]; then
+
${pkgs.gum}/bin/gum style --foreground 214 "No message provided. Aborting."
+
${pkgs.gum}/bin/gum spin --spinner dot --title "Posting to Bluesky..." -- /bin/bash <<EOF
+
# Generate JWT for ACCOUNT1
+
account1_response=\$(${pkgs.curl}/bin/curl -s -X POST \
+
-H "Content-Type: application/json" \
+
"identifier": "'$ACCOUNT1'",
+
"password": "'$ACCOUNT1_PASSWORD'"
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
+
account1_jwt=\$(echo "\$account1_response" | ${pkgs.jq}/bin/jq -r '.accessJwt')
+
if [[ -z "\$account1_jwt" || "\$account1_jwt" == "null" ]]; then
+
echo "Failed to authenticate account $ACCOUNT1" >&2
+
echo "Response: \$account1_response" >&2
+
# Generate JWT for ACCOUNT2
+
account2_response=\$(${pkgs.curl}/bin/curl -s -X POST \
+
-H "Content-Type: application/json" \
+
"identifier": "'$ACCOUNT2'",
+
"password": "'$ACCOUNT2_PASSWORD'"
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
+
account2_jwt=\$(echo "\$account2_response" | ${pkgs.jq}/bin/jq -r '.accessJwt')
+
if [[ -z "\$account2_jwt" || "\$account2_jwt" == "null" ]]; then
+
echo "Failed to authenticate account $ACCOUNT2" >&2
+
echo "Response: \$account2_response" >&2
+
# Post to ACCOUNT1 as a.status.updates
+
account1_post_response=\$(${pkgs.curl}/bin/curl -s -X POST \
+
-H "Content-Type: application/json" \
+
-H "Authorization: Bearer \$account1_jwt" \
+
"collection": "a.status.update",
+
"\$type": "a.status.update",
+
"text": "'"$message"'",
+
"createdAt": "'\$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
+
if [[ \$(echo "\$account1_post_response" | ${pkgs.jq}/bin/jq -r 'has("error")') == "true" ]]; then
+
echo "Error posting to $ACCOUNT1:" >&2
+
echo "\$account1_post_response" | ${pkgs.jq}/bin/jq >&2
+
# Post to ACCOUNT2 as normal post
+
account2_post_response=\$(${pkgs.curl}/bin/curl -s -X POST \
+
-H "Content-Type: application/json" \
+
-H "Authorization: Bearer \$account2_jwt" \
+
"collection": "app.bsky.feed.post",
+
"\$type": "app.bsky.feed.post",
+
"text": "'"$message"'",
+
"createdAt": "'\$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
+
if [[ \$(echo "\$account2_post_response" | ${pkgs.jq}/bin/jq -r 'has("error")') == "true" ]]; then
+
echo "Error posting to $ACCOUNT2:" >&2
+
echo "\$account2_post_response" | ${pkgs.jq}/bin/jq >&2
+
if [[ $? -eq 0 ]]; then
+
${pkgs.gum}/bin/gum style --foreground 35 "✓ Posted successfully!"
+
${pkgs.gum}/bin/gum style --foreground 196 "✗ Failed to post"
+
ghostty-setup = pkgs.writeShellScriptBin "ghostty-setup" ''
+
# Copy Ghostty terminfo to remote host
+
if [[ -z "$target" ]]; then
+
target=$(${pkgs.gum}/bin/gum input --placeholder "user@host" --prompt "Remote host: ")
+
if [[ -z "$target" ]]; then
+
${pkgs.gum}/bin/gum style --foreground 196 "No target provided"
+
${pkgs.gum}/bin/gum style --bold --foreground 212 "Setting up Ghostty on $target"
+
${pkgs.gum}/bin/gum spin --spinner dot --title "Copying SSH key to $target..." -- \
+
${pkgs.openssh}/bin/ssh-copy-id "$target" 2>&1
+
if [[ $? -ne 0 ]]; then
+
${pkgs.gum}/bin/gum style --foreground 196 "✗ SSH key copy failed"
+
${pkgs.gum}/bin/gum style --foreground 35 "✓ SSH key copied"
+
${pkgs.gum}/bin/gum spin --spinner dot --title "Installing xterm-ghostty terminfo on $target..." -- \
+
bash -c "${pkgs.ncurses}/bin/infocmp -x xterm-ghostty | ${pkgs.openssh}/bin/ssh '$target' 'tic -x -'" 2>&1
+
if [[ $? -ne 0 ]]; then
+
${pkgs.gum}/bin/gum style --foreground 196 "✗ Terminfo transfer failed"
+
${pkgs.gum}/bin/gum style --foreground 35 "✓ Terminfo installed"
+
${pkgs.gum}/bin/gum style --foreground 35 --bold "Done! Ghostty is ready on $target"
options.atelier.shell.enable = lib.mkEnableOption "Custom shell config";
···
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
···
home.packages = with pkgs; [
pkgs.unstable.wakatime-cli
inputs.terminal-wakatime.packages.${pkgs.system}.default