Kieran's opinionated (and probably slightly dumb) nix config

feat: add machine name setting

dunkirk.sh 584bc622 cd999304

verified
+410 -402
+410 -402
home-manager/app/shell.nix
··· 5 5 ... 6 6 }: 7 7 { 8 - programs.oh-my-posh = { 9 - enable = true; 10 - enableZshIntegration = true; 11 - settings = { 12 - upgrade = { 13 - notice = false; 14 - interval = "2w"; 15 - auto = false; 16 - }; 17 - version = 2; 18 - final_space = true; 19 - console_title_template = "{{ .Shell }} in {{ .Folder }}"; 20 - blocks = [ 21 - { 22 - type = "prompt"; 23 - alignment = "left"; 24 - newline = true; 25 - segments = [ 26 - { 27 - type = "path"; 28 - style = "plain"; 29 - background = "transparent"; 30 - foreground = "blue"; 31 - template = "{{ .Path }} "; 32 - properties = { 33 - style = "full"; 34 - }; 35 - } 36 - { 37 - type = "git"; 38 - style = "plain"; 39 - foreground = "p:grey"; 40 - background = "transparent"; 41 - template = "{{if not .Detached}}{{ .HEAD }}{{else}}@{{ printf \"%.7s\" .Commit.Sha }}{{end}}{{ if .Staging.Changed }} ({{ .Staging.String }}){{ end }}{{ if .Working.Changed }}*{{ end }} <cyan>{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}</>"; 42 - properties = { 43 - branch_icon = ""; 44 - branch_identical_icon = ""; 45 - branch_gone_icon = ""; 46 - branch_ahead_icon = "⇡"; 47 - branch_behind_icon = "⇣"; 48 - commit_icon = "@"; 49 - fetch_status = true; 50 - }; 51 - } 8 + config = { 9 + programs.oh-my-posh = { 10 + enable = true; 11 + enableZshIntegration = true; 12 + settings = { 13 + upgrade = { 14 + notice = false; 15 + interval = "2w"; 16 + auto = false; 17 + }; 18 + version = 2; 19 + final_space = true; 20 + console_title_template = "{{ .Shell }} in {{ .Folder }}"; 21 + blocks = [ 22 + { 23 + type = "prompt"; 24 + alignment = "left"; 25 + newline = true; 26 + segments = [ 27 + { 28 + type = "session"; 29 + background = "transparent"; 30 + foreground = "yellow"; 31 + template = "{{ if .SSHSession }}{{.HostName}} {{ end }}"; 32 + } 33 + { 34 + type = "path"; 35 + style = "plain"; 36 + background = "transparent"; 37 + foreground = "blue"; 38 + template = "{{ .Path }} "; 39 + properties = { 40 + style = "full"; 41 + }; 42 + } 43 + { 44 + type = "git"; 45 + style = "plain"; 46 + foreground = "p:grey"; 47 + background = "transparent"; 48 + template = "{{if not .Detached}}{{ .HEAD }}{{else}}@{{ printf \"%.7s\" .Commit.Sha }}{{end}}{{ if .Staging.Changed }} ({{ .Staging.String }}){{ end }}{{ if .Working.Changed }}*{{ end }} <cyan>{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}</>"; 49 + properties = { 50 + branch_icon = ""; 51 + branch_identical_icon = ""; 52 + branch_gone_icon = ""; 53 + branch_ahead_icon = "⇡"; 54 + branch_behind_icon = "⇣"; 55 + commit_icon = "@"; 56 + fetch_status = true; 57 + }; 58 + } 59 + ]; 60 + } 61 + { 62 + type = "rprompt"; 63 + overflow = "hidden"; 64 + segments = [ 65 + { 66 + type = "executiontime"; 67 + style = "plain"; 68 + foreground = "yellow"; 69 + background = "transparent"; 70 + template = "{{ .FormattedMs }}"; 71 + properties = { 72 + threshold = 3000; 73 + }; 74 + } 75 + { 76 + type = "nix-shell"; 77 + style = "plain"; 78 + foreground = "red"; 79 + background = "transparent"; 80 + template = ''{{if ne .Type "unknown" }} {{ .Type }}{{ end }}''; 81 + } 82 + ]; 83 + } 84 + { 85 + type = "prompt"; 86 + alignment = "left"; 87 + newline = true; 88 + segments = [ 89 + { 90 + type = "text"; 91 + style = "plain"; 92 + foreground_templates = [ 93 + "{{if gt .Code 0}}red{{end}}" 94 + "{{if eq .Code 0}}magenta{{end}}" 95 + ]; 96 + background = "transparent"; 97 + template = "❯"; 98 + } 99 + ]; 100 + } 101 + ]; 102 + transient_prompt = { 103 + foreground_templates = [ 104 + "{{if gt .Code 0}}red{{end}}" 105 + "{{if eq .Code 0}}magenta{{end}}" 52 106 ]; 53 - } 54 - { 55 - type = "rprompt"; 56 - overflow = "hidden"; 57 - segments = [ 58 - { 59 - type = "executiontime"; 60 - style = "plain"; 61 - foreground = "yellow"; 62 - background = "transparent"; 63 - template = "{{ .FormattedMs }}"; 64 - properties = { 65 - threshold = 3000; 66 - }; 67 - } 68 - { 69 - type = "nix-shell"; 70 - style = "plain"; 71 - foreground = "red"; 72 - background = "transparent"; 73 - template = ''{{if ne .Type "unknown" }} {{ .Type }}{{ end }}''; 74 - } 75 - ]; 76 - } 77 - { 78 - type = "prompt"; 79 - alignment = "left"; 80 - newline = true; 81 - segments = [ 82 - { 83 - type = "text"; 84 - style = "plain"; 85 - foreground_templates = [ 86 - "{{if gt .Code 0}}red{{end}}" 87 - "{{if eq .Code 0}}magenta{{end}}" 88 - ]; 89 - background = "transparent"; 90 - template = "❯"; 91 - } 92 - ]; 93 - } 94 - ]; 95 - transient_prompt = { 96 - foreground_templates = [ 97 - "{{if gt .Code 0}}red{{end}}" 98 - "{{if eq .Code 0}}magenta{{end}}" 99 - ]; 100 - background = "transparent"; 101 - template = "❯ "; 102 - }; 103 - secondary_prompt = { 104 - foreground = "p:gray"; 105 - background = "transparent"; 106 - template = "❯❯ "; 107 - }; 108 - palette = { 109 - grey = "#6c6c6c"; 107 + background = "transparent"; 108 + template = "❯ "; 109 + }; 110 + secondary_prompt = { 111 + foreground = "p:gray"; 112 + background = "transparent"; 113 + template = "❯❯ "; 114 + }; 115 + palette = { 116 + grey = "#6c6c6c"; 117 + }; 110 118 }; 111 119 }; 112 - }; 113 120 114 - programs.zsh = { 115 - enable = true; 116 - enableCompletion = true; 117 - syntaxHighlighting.enable = true; 121 + programs.zsh = { 122 + enable = true; 123 + enableCompletion = true; 124 + syntaxHighlighting.enable = true; 118 125 119 - shellAliases = { 120 - lazygit = "gitui"; 121 - cat = "bat"; 122 - ls = "eza"; 123 - ll = "eza -l"; 124 - la = "eza -la"; 125 - gc = "git commit"; 126 - gp = "git push"; 127 - rr = "rm -Rf"; 128 - ghrpc = "gh repo create -c"; 129 - goops = "git commit --amend --no-edit && git push --force-with-lease"; 130 - chngwall = "~/.config/hypr/randomize.sh"; 131 - vi = "nvim"; 132 - vim = "nvim"; 133 - }; 134 - initContent = '' 135 - #ssh auto reconnect 136 - assh() { 137 - local host=$1 138 - local port=$2 139 - while true; do 140 - ssh -p $port -o "BatchMode yes" $host || sleep 1 141 - done 142 - } 143 - # hackatime summary 144 - summary() { 145 - local user_id=$1 146 - curl -X 'GET' \ 147 - "https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \ 148 - -H 'accept: application/json' \ 149 - -H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' | jq '. + { 150 - "total_categories_sum": (.categories | map(.total) | add), 151 - "total_categories_human_readable": ( 152 - (.categories | map(.total) | add) as $total_seconds | 153 - "\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s" 154 - ), 155 - "projectsKeys": ( 156 - .projects | sort_by(-.total) | map(.key) 157 - ) 158 - }' 159 - } 126 + shellAliases = { 127 + lazygit = "gitui"; 128 + cat = "bat"; 129 + ls = "eza"; 130 + ll = "eza -l"; 131 + la = "eza -la"; 132 + gc = "git commit"; 133 + gp = "git push"; 134 + rr = "rm -Rf"; 135 + ghrpc = "gh repo create -c"; 136 + goops = "git commit --amend --no-edit && git push --force-with-lease"; 137 + chngwall = "~/.config/hypr/randomize.sh"; 138 + vi = "nvim"; 139 + vim = "nvim"; 140 + }; 141 + initContent = '' 142 + #ssh auto reconnect 143 + assh() { 144 + local host=$1 145 + local port=$2 146 + while true; do 147 + ssh -p $port -o "BatchMode yes" $host || sleep 1 148 + done 149 + } 150 + # hackatime summary 151 + summary() { 152 + local user_id=$1 153 + curl -X 'GET' \ 154 + "https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \ 155 + -H 'accept: application/json' \ 156 + -H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' | jq '. + { 157 + "total_categories_sum": (.categories | map(.total) | add), 158 + "total_categories_human_readable": ( 159 + (.categories | map(.total) | add) as $total_seconds | 160 + "\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s" 161 + ), 162 + "projectsKeys": ( 163 + .projects | sort_by(-.total) | map(.key) 164 + ) 165 + }' 166 + } 167 + 168 + tangled() { 169 + # Configuration variables - set these to your defaults 170 + local default_plc_id="did:plc:krxbvxvis5skq7jj6eot23ul" 171 + local default_github_username="taciturnaxolotl" 172 + local extracted_github_username="" 160 173 161 - tangled() { 162 - # Configuration variables - set these to your defaults 163 - local default_plc_id="did:plc:krxbvxvis5skq7jj6eot23ul" 164 - local default_github_username="taciturnaxolotl" 165 - local extracted_github_username="" 174 + # Check if current directory is a git repository 175 + if ! git rev-parse --is-inside-work-tree &>/dev/null; then 176 + echo "Not a git repository" 177 + return 1 178 + fi 166 179 167 - # Check if current directory is a git repository 168 - if ! git rev-parse --is-inside-work-tree &>/dev/null; then 169 - echo "Not a git repository" 170 - return 1 171 - fi 180 + # Get the repository name from the current directory 181 + local repo_name=$(basename "$(git rev-parse --show-toplevel)") 172 182 173 - # Get the repository name from the current directory 174 - local repo_name=$(basename "$(git rev-parse --show-toplevel)") 183 + # Check if origin remote exists and points to ember 184 + local origin_url=$(git remote get-url origin 2>/dev/null) 185 + local origin_ember=false 175 186 176 - # Check if origin remote exists and points to ember 177 - local origin_url=$(git remote get-url origin 2>/dev/null) 178 - local origin_ember=false 187 + if [[ -n "$origin_url" ]]; then 188 + # Try to extract GitHub username if origin is a GitHub URL 189 + if [[ "$origin_url" == *"github.com"* ]]; then 190 + extracted_github_username=$(echo "$origin_url" | sed -E 's/.*github\.com[:/]([^/]+)\/.*$/\1/') 191 + # Override the default username with the extracted one 192 + default_github_username=$extracted_github_username 193 + fi 179 194 180 - if [[ -n "$origin_url" ]]; then 181 - # Try to extract GitHub username if origin is a GitHub URL 182 - if [[ "$origin_url" == *"github.com"* ]]; then 183 - extracted_github_username=$(echo "$origin_url" | sed -E 's/.*github\.com[:/]([^/]+)\/.*$/\1/') 184 - # Override the default username with the extracted one 185 - default_github_username=$extracted_github_username 195 + if [[ "$origin_url" == *"ember"* ]]; then 196 + origin_ember=true 197 + echo "✅ Origin remote exists and points to ember" 198 + else 199 + echo "⚠️ Origin remote exists but doesn't point to ember" 200 + fi 201 + else 202 + echo "⚠️ Origin remote doesn't exist" 186 203 fi 187 204 188 - if [[ "$origin_url" == *"ember"* ]]; then 189 - origin_ember=true 190 - echo "✅ Origin remote exists and points to ember" 205 + # Check if github remote exists 206 + local github_exists=false 207 + if git remote get-url github &>/dev/null; then 208 + github_exists=true 209 + echo "✅ GitHub remote exists" 191 210 else 192 - echo "⚠️ Origin remote exists but doesn't point to ember" 211 + echo "⚠️ GitHub remote doesn't exist" 193 212 fi 194 - else 195 - echo "⚠️ Origin remote doesn't exist" 196 - fi 197 213 198 - # Check if github remote exists 199 - local github_exists=false 200 - if git remote get-url github &>/dev/null; then 201 - github_exists=true 202 - echo "✅ GitHub remote exists" 203 - else 204 - echo "⚠️ GitHub remote doesn't exist" 205 - fi 214 + # Fix remotes if needed 215 + if [[ "$origin_ember" = false || "$github_exists" = false ]]; then 216 + echo "Setting up remotes..." 206 217 207 - # Fix remotes if needed 208 - if [[ "$origin_ember" = false || "$github_exists" = false ]]; then 209 - echo "Setting up remotes..." 218 + # Prompt for PLC identifier if needed 219 + local plc_id="" 220 + if [[ "$origin_ember" = false ]]; then 221 + echo -n "Enter your PLC identifier [default: $default_plc_id]: " 222 + read plc_input 223 + plc_id=''${plc_input:-$default_plc_id} 224 + fi 210 225 211 - # Prompt for PLC identifier if needed 212 - local plc_id="" 213 - if [[ "$origin_ember" = false ]]; then 214 - echo -n "Enter your PLC identifier [default: $default_plc_id]: " 215 - read plc_input 216 - plc_id=''${plc_input:-$default_plc_id} 217 - fi 226 + # Prompt for GitHub username with default from origin if available 227 + local github_username="" 228 + if [[ "$github_exists" = false ]]; then 229 + echo -n "Enter your GitHub username [default: $default_github_username]: " 230 + read github_input 231 + github_username=''${github_input:-$default_github_username} 232 + fi 218 233 219 - # Prompt for GitHub username with default from origin if available 220 - local github_username="" 221 - if [[ "$github_exists" = false ]]; then 222 - echo -n "Enter your GitHub username [default: $default_github_username]: " 223 - read github_input 224 - github_username=''${github_input:-$default_github_username} 225 - fi 234 + # Set up origin remote if needed 235 + if [[ "$origin_ember" = false && -n "$plc_id" ]]; then 236 + if git remote get-url origin &>/dev/null; then 237 + git remote remove origin 238 + fi 239 + git remote add origin "git@ember:''${plc_id}/''${repo_name}" 240 + echo "✅ Set up origin remote: git@ember:''${plc_id}/''${repo_name}" 241 + fi 226 242 227 - # Set up origin remote if needed 228 - if [[ "$origin_ember" = false && -n "$plc_id" ]]; then 229 - if git remote get-url origin &>/dev/null; then 230 - git remote remove origin 243 + # Set up GitHub remote if needed 244 + if [[ "$github_exists" = false && -n "$github_username" ]]; then 245 + git remote add github "git@github.com:''${github_username}/''${repo_name}.git" 246 + echo "✅ Set up GitHub remote: git@github.com:''${github_username}/''${repo_name}.git" 231 247 fi 232 - git remote add origin "git@ember:''${plc_id}/''${repo_name}" 233 - echo "✅ Set up origin remote: git@ember:''${plc_id}/''${repo_name}" 248 + else 249 + echo "Remotes are correctly configured" 234 250 fi 251 + } 235 252 236 - # Set up GitHub remote if needed 237 - if [[ "$github_exists" = false && -n "$github_username" ]]; then 238 - git remote add github "git@github.com:''${github_username}/''${repo_name}.git" 239 - echo "✅ Set up GitHub remote: git@github.com:''${github_username}/''${repo_name}.git" 253 + # Post AtProto status updates 254 + now() { 255 + local message="" 256 + local prompt_message=true 257 + local account1_name="" 258 + local account2_name="" 259 + local account1_jwt="" 260 + local account2_jwt="" 261 + 262 + # Load account information from agenix secrets 263 + if [[ -f "/run/agenix/bluesky" ]]; then 264 + source "/run/agenix/bluesky" 265 + else 266 + echo "Error: Bluesky credentials file not found at /run/agenix/bluesky" 267 + return 1 240 268 fi 241 - else 242 - echo "Remotes are correctly configured" 243 - fi 244 - } 245 269 246 - # Post AtProto status updates 247 - now() { 248 - local message="" 249 - local prompt_message=true 250 - local account1_name="" 251 - local account2_name="" 252 - local account1_jwt="" 253 - local account2_jwt="" 270 + # Parse arguments 271 + while [[ $# -gt 0 ]]; do 272 + case "$1" in 273 + -m|--message) 274 + message="$2" 275 + prompt_message=false 276 + shift 2 277 + ;; 278 + *) 279 + echo "Usage: now [-m|--message \"your message\"]" 280 + return 1 281 + ;; 282 + esac 283 + done 254 284 255 - # Load account information from agenix secrets 256 - if [[ -f "/run/agenix/bluesky" ]]; then 257 - source "/run/agenix/bluesky" 258 - else 259 - echo "Error: Bluesky credentials file not found at /run/agenix/bluesky" 260 - return 1 261 - fi 285 + # Prompt for message if none provided 286 + if [[ "$prompt_message" = true ]]; then 287 + echo -n "$ACCOUNT1 is: " 288 + read message 262 289 263 - # Parse arguments 264 - while [[ $# -gt 0 ]]; do 265 - case "$1" in 266 - -m|--message) 267 - message="$2" 268 - prompt_message=false 269 - shift 2 270 - ;; 271 - *) 272 - echo "Usage: now [-m|--message \"your message\"]" 290 + if [[ -z "$message" ]]; then 291 + echo "No message provided. Aborting." 273 292 return 1 274 - ;; 275 - esac 276 - done 293 + fi 294 + fi 295 + 296 + # Generate JWT for ACCOUNT1 297 + local account1_response=$(curl -s -X POST \ 298 + -H "Content-Type: application/json" \ 299 + -d '{ 300 + "identifier": "'$ACCOUNT1'", 301 + "password": "'$ACCOUNT1_PASSWORD'" 302 + }' \ 303 + "https://bsky.social/xrpc/com.atproto.server.createSession") 277 304 278 - # Prompt for message if none provided 279 - if [[ "$prompt_message" = true ]]; then 280 - echo -n "$ACCOUNT1 is: " 281 - read message 305 + account1_jwt=$(echo "$account1_response" | jq -r '.accessJwt') 282 306 283 - if [[ -z "$message" ]]; then 284 - echo "No message provided. Aborting." 307 + if [[ -z "$account1_jwt" || "$account1_jwt" == "null" ]]; then 308 + echo "Failed to authenticate account $ACCOUNT1" 309 + echo "Response: $account1_response" 285 310 return 1 286 311 fi 287 - fi 288 312 289 - # Generate JWT for ACCOUNT1 290 - local account1_response=$(curl -s -X POST \ 291 - -H "Content-Type: application/json" \ 292 - -d '{ 293 - "identifier": "'$ACCOUNT1'", 294 - "password": "'$ACCOUNT1_PASSWORD'" 295 - }' \ 296 - "https://bsky.social/xrpc/com.atproto.server.createSession") 313 + # Generate JWT for ACCOUNT2 314 + local account2_response=$(curl -s -X POST \ 315 + -H "Content-Type: application/json" \ 316 + -d '{ 317 + "identifier": "'$ACCOUNT2'", 318 + "password": "'$ACCOUNT2_PASSWORD'" 319 + }' \ 320 + "https://bsky.social/xrpc/com.atproto.server.createSession") 297 321 298 - account1_jwt=$(echo "$account1_response" | jq -r '.accessJwt') 322 + account2_jwt=$(echo "$account2_response" | jq -r '.accessJwt') 299 323 300 - if [[ -z "$account1_jwt" || "$account1_jwt" == "null" ]]; then 301 - echo "Failed to authenticate account $ACCOUNT1" 302 - echo "Response: $account1_response" 303 - return 1 304 - fi 324 + if [[ -z "$account2_jwt" || "$account2_jwt" == "null" ]]; then 325 + echo "Failed to authenticate account $ACCOUNT2" 326 + echo "Response: $account2_response" 327 + return 1 328 + fi 305 329 306 - # Generate JWT for ACCOUNT2 307 - local account2_response=$(curl -s -X POST \ 308 - -H "Content-Type: application/json" \ 309 - -d '{ 310 - "identifier": "'$ACCOUNT2'", 311 - "password": "'$ACCOUNT2_PASSWORD'" 312 - }' \ 313 - "https://bsky.social/xrpc/com.atproto.server.createSession") 330 + # Post to ACCOUNT1 as a.status.updates 331 + local account1_post_response=$(curl -s -X POST \ 332 + -H "Content-Type: application/json" \ 333 + -H "Authorization: Bearer $account1_jwt" \ 334 + -d '{ 335 + "collection": "a.status.update", 336 + "repo": "'$ACCOUNT1'", 337 + "record": { 338 + "$type": "a.status.update", 339 + "text": "'"$message"'", 340 + "createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" 341 + } 342 + }' \ 343 + "https://bsky.social/xrpc/com.atproto.repo.createRecord") 314 344 315 - account2_jwt=$(echo "$account2_response" | jq -r '.accessJwt') 316 - 317 - if [[ -z "$account2_jwt" || "$account2_jwt" == "null" ]]; then 318 - echo "Failed to authenticate account $ACCOUNT2" 319 - echo "Response: $account2_response" 320 - return 1 321 - fi 322 - 323 - # Post to ACCOUNT1 as a.status.updates 324 - local account1_post_response=$(curl -s -X POST \ 325 - -H "Content-Type: application/json" \ 326 - -H "Authorization: Bearer $account1_jwt" \ 327 - -d '{ 328 - "collection": "a.status.update", 329 - "repo": "'$ACCOUNT1'", 330 - "record": { 331 - "$type": "a.status.update", 332 - "text": "'"$message"'", 333 - "createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" 334 - } 335 - }' \ 336 - "https://bsky.social/xrpc/com.atproto.repo.createRecord") 345 + if [[ $(echo "$account1_post_response" | jq -r 'has("error")') == "true" ]]; then 346 + echo "Error posting to $ACCOUNT1:" 347 + echo "$account1_post_response" | jq 348 + return 1 349 + fi 337 350 338 - if [[ $(echo "$account1_post_response" | jq -r 'has("error")') == "true" ]]; then 339 - echo "Error posting to $ACCOUNT1:" 340 - echo "$account1_post_response" | jq 341 - return 1 342 - fi 351 + # Post to ACCOUNT2 as normal post 352 + local account2_post_response=$(curl -s -X POST \ 353 + -H "Content-Type: application/json" \ 354 + -H "Authorization: Bearer $account2_jwt" \ 355 + -d '{ 356 + "collection": "app.bsky.feed.post", 357 + "repo": "'$ACCOUNT2'", 358 + "record": { 359 + "$type": "app.bsky.feed.post", 360 + "text": "'"$message"'", 361 + "createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" 362 + } 363 + }' \ 364 + "https://bsky.social/xrpc/com.atproto.repo.createRecord") 343 365 344 - # Post to ACCOUNT2 as normal post 345 - local account2_post_response=$(curl -s -X POST \ 346 - -H "Content-Type: application/json" \ 347 - -H "Authorization: Bearer $account2_jwt" \ 348 - -d '{ 349 - "collection": "app.bsky.feed.post", 350 - "repo": "'$ACCOUNT2'", 351 - "record": { 352 - "$type": "app.bsky.feed.post", 353 - "text": "'"$message"'", 354 - "createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" 355 - } 356 - }' \ 357 - "https://bsky.social/xrpc/com.atproto.repo.createRecord") 366 + if [[ $(echo "$account2_post_response" | jq -r 'has("error")') == "true" ]]; then 367 + echo "Error posting to $ACCOUNT2:" 368 + echo "$account2_post_response" | jq 369 + return 1 370 + fi 358 371 359 - if [[ $(echo "$account2_post_response" | jq -r 'has("error")') == "true" ]]; then 360 - echo "Error posting to $ACCOUNT2:" 361 - echo "$account2_post_response" | jq 362 - return 1 363 - fi 372 + echo "done" 373 + } 364 374 365 - echo "done" 366 - } 375 + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 376 + zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}" 377 + zstyle ':completion:*' menu no 378 + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' 379 + zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' 367 380 368 - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 369 - zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}" 370 - zstyle ':completion:*' menu no 371 - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' 372 - zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' 381 + eval "$(terminal-wakatime init)" 382 + ''; 383 + history = { 384 + size = 10000; 385 + path = "${config.xdg.dataHome}/zsh/history"; 386 + ignoreDups = true; 387 + ignoreAllDups = true; 388 + ignoreSpace = true; 389 + expireDuplicatesFirst = true; 390 + share = true; 391 + extended = true; 392 + append = true; 393 + }; 373 394 374 - eval "$(terminal-wakatime init)" 375 - ''; 376 - history = { 377 - size = 10000; 378 - path = "${config.xdg.dataHome}/zsh/history"; 379 - ignoreDups = true; 380 - ignoreAllDups = true; 381 - ignoreSpace = true; 382 - expireDuplicatesFirst = true; 383 - share = true; 384 - extended = true; 385 - append = true; 386 - }; 395 + oh-my-zsh = { 396 + enable = true; 397 + plugins = [ 398 + "git" 399 + "sudo" 400 + "docker" 401 + "git" 402 + "command-not-found" 403 + "colored-man-pages" 404 + ]; 405 + }; 387 406 388 - oh-my-zsh = { 389 - enable = true; 390 407 plugins = [ 391 - "git" 392 - "sudo" 393 - "docker" 394 - "git" 395 - "command-not-found" 396 - "colored-man-pages" 408 + { 409 + # will source zsh-autosuggestions.plugin.zsh 410 + name = "zsh-autosuggestions"; 411 + src = pkgs.fetchFromGitHub { 412 + owner = "zsh-users"; 413 + repo = "zsh-autosuggestions"; 414 + rev = "v0.7.0"; 415 + sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w="; 416 + }; 417 + } 418 + { 419 + # will source zsh-sytax-highlighting 420 + name = "zsh-sytax-highlighting"; 421 + src = pkgs.fetchFromGitHub { 422 + owner = "zsh-users"; 423 + repo = "zsh-syntax-highlighting"; 424 + rev = "0.8.0"; 425 + sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo="; 426 + }; 427 + } 428 + { 429 + # fzf tab completion 430 + name = "fzf-tab"; 431 + src = pkgs.fetchFromGitHub { 432 + owner = "aloxaf"; 433 + repo = "fzf-tab"; 434 + rev = "v1.1.2"; 435 + sha256 = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg="; 436 + }; 437 + } 397 438 ]; 398 439 }; 399 440 400 - plugins = [ 401 - { 402 - # will source zsh-autosuggestions.plugin.zsh 403 - name = "zsh-autosuggestions"; 404 - src = pkgs.fetchFromGitHub { 405 - owner = "zsh-users"; 406 - repo = "zsh-autosuggestions"; 407 - rev = "v0.7.0"; 408 - sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w="; 409 - }; 410 - } 411 - { 412 - # will source zsh-sytax-highlighting 413 - name = "zsh-sytax-highlighting"; 414 - src = pkgs.fetchFromGitHub { 415 - owner = "zsh-users"; 416 - repo = "zsh-syntax-highlighting"; 417 - rev = "0.8.0"; 418 - sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo="; 419 - }; 420 - } 421 - { 422 - # fzf tab completion 423 - name = "fzf-tab"; 424 - src = pkgs.fetchFromGitHub { 425 - owner = "aloxaf"; 426 - repo = "fzf-tab"; 427 - rev = "v1.1.2"; 428 - sha256 = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg="; 429 - }; 430 - } 431 - ]; 432 - }; 441 + programs.zoxide = { 442 + enable = true; 443 + enableZshIntegration = true; 444 + }; 433 445 434 - programs.zoxide = { 435 - enable = true; 436 - enableZshIntegration = true; 437 - }; 438 - 439 - programs.fzf = { 440 - enable = true; 441 - enableZshIntegration = true; 442 - colors = { 443 - bg = lib.mkForce ""; 446 + programs.fzf = { 447 + enable = true; 448 + enableZshIntegration = true; 449 + colors = { 450 + bg = lib.mkForce ""; 451 + }; 444 452 }; 445 - }; 446 453 447 - programs.atuin = { 448 - enable = true; 449 - settings = { 450 - auto_sync = true; 451 - sync_frequency = "5m"; 452 - sync_address = "https://api.atuin.sh"; 453 - search_mode = "fuzzy"; 454 - #session_path = config.age.secrets."atuin-session".path; 455 - #key_path = config.age.secrets."atuin-key".path; 456 - update_check = false; 457 - style = "auto"; 458 - sync.records = true; 459 - dotfiles.enabled = false; 454 + programs.atuin = { 455 + enable = true; 456 + settings = { 457 + auto_sync = true; 458 + sync_frequency = "5m"; 459 + sync_address = "https://api.atuin.sh"; 460 + search_mode = "fuzzy"; 461 + #session_path = config.age.secrets."atuin-session".path; 462 + #key_path = config.age.secrets."atuin-key".path; 463 + update_check = false; 464 + style = "auto"; 465 + sync.records = true; 466 + dotfiles.enabled = false; 467 + }; 460 468 }; 461 469 }; 462 470 }