Răsfoiți Sursa

feat(brew): reorganize `Brewfile`

Joe 4 luni în urmă
părinte
comite
993fe9657f
4 a modificat fișierele cu 84 adăugiri și 160 ștergeri
  1. 70 144
      .config/brew/Brewfile
  2. 13 11
      .config/brew/README.md
  3. 1 0
      .config/zsh/.zshenv
  4. 0 5
      .config/zsh/.zshrc

+ 70 - 144
.config/brew/Brewfile

@@ -1,185 +1,111 @@
-tap "common-fate/granted"
-tap "heroku/brew"
-tap "homebrew/bundle"
-tap "homebrew/services"
-tap "koekeishiya/formulae"
-tap "waydabber/betterdisplay"
-# AWS Cloud Development Kit - framework for defining AWS infra as code
-brew "aws-cdk"
-# Pyright fork with various improvements and built-in pylance features
-brew "basedpyright"
-# Language Server for Bash
-brew "bash-language-server"
-# Object-file caching compiler wrapper
-brew "ccache"
-# Cross-platform make
-brew "cmake"
-# Strongly specified, highly compatible implementation of Markdown
-brew "cmark"
-# GNU File, Shell, and Text utilities
+# CLI
 brew "coreutils"
-# Apjanke's fork of the classic cowsay project
 brew "cowsay"
-# Library for command-line editing
+brew "fd"
+brew "fortune"
+brew "fswatch"
+brew "fzf"
+brew "gnu-sed"
+brew "jq"
+brew "lsd"
+brew "make"
+brew "parallel"
 brew "readline"
-# Secure runtime for JavaScript and TypeScript
+brew "ripgrep"
+brew "shfmt"
+brew "tio"
+brew "tmux"
+brew "watch"
+brew "wget"
+
+# Utils
+brew "ccache"
+brew "cmake"
+brew "cmark"
 brew "deno"
-# Pack, ship and run any application as a lightweight container
 brew "docker"
-# Device tree compiler
 brew "dtc"
-# Simple, fast and user-friendly alternative to find
-brew "fd"
-# C library SSHv1/SSHv2 client and server protocols
-brew "libssh"
-# Low-level access to audio, keyboard, mouse, joystick, and graphics
-brew "sdl2"
-# Play, record, convert, and stream audio and video
 brew "ffmpeg"
-# Tool to install, manage and use Progressive Web Apps in Mozilla Firefox
 brew "firefoxpwa"
-# Infamous electronic fortune-cookie generator
-brew "fortune"
-# Monitor a directory for changes and run a shell command
-brew "fswatch"
-# Command-line fuzzy finder written in Go
-brew "fzf"
-# Interact with Google Gemini AI models from the command-line
 brew "gemini-cli"
-# GitHub command-line tool
 brew "gh"
-# Distributed revision control system
 brew "git"
-# GNU implementation of the famous stream editor
-brew "gnu-sed"
-# Open source programming language to build simple/reliable/efficient software
 brew "go"
-# Language server for the Go language
-brew "gopls"
-# Perfect hash function generator
 brew "gperf"
-# Interpreted, interactive, object-oriented programming language
-brew "python@3.13"
-# GitHub Markdown previewer
 brew "grip"
-# CLI for Heroku
-brew "heroku"
-# Lightweight and flexible command-line JSON processor
-brew "jq"
-# Lazier way to manage everything docker
 brew "lazydocker"
-# Simple terminal UI for git commands
 brew "lazygit"
-# Key-value storage library with ordered mapping
 brew "leveldb"
-# Implementation of the file(1) command
 brew "libmagic"
-# Postgres C API library
 brew "libpq"
-# Clone of ls with colorful output, file type icons, and more
-brew "lsd"
-# Language Server for the Lua language
-brew "lua-language-server"
-# Package manager for the Lua programming language
+brew "libssh"
 brew "luarocks"
-# Bare libuv bindings for lua
 brew "luv"
-# Utility for directing compilation
-brew "make"
-# Language Server Protocol for Markdown
-brew "marksman"
-# Zero-dependency real-time media server and media proxy
 brew "mediamtx", restart_service: :changed
-# Text-based UI library
 brew "ncurses"
-# Ambitious Vim-fork focused on extensibility and agility
 brew "neovim"
-# Small build system for use with gyp or CMake
 brew "ninja"
-# Create, run, and share large language models (LLMs)
 brew "ollama", restart_service: :changed
-# Shell command parallelization utility
-brew "parallel"
-# CLI for Postgres with auto-completion and syntax highlighting
+brew "pandoc"
 brew "pgcli"
-# PostgreSQL syntax beautifier
 brew "pgformatter"
-# Package compiler and linker metadata toolkit
 brew "pkgconf"
-# Object-relational database system
 brew "postgresql@16"
-# Code formatter for JavaScript, CSS, JSON, GraphQL, Markdown, YAML
 brew "prettier"
-# Generic machine emulator and virtualizer
+brew "python@3.13"
 brew "qemu"
-# Search tool like grep and The Silver Searcher
-brew "ripgrep"
-# Extremely fast Python linter, written in Rust
 brew "ruff"
-# Safe, concurrent, practical language
 brew "rust"
-# Experimental Rust compiler front-end for IDEs
-brew "rust-analyzer"
-# Autoformat shell script source code
-brew "shfmt"
-# Language Server for SQL
-brew "sql-language-server"
-# TOML toolkit written in Rust
+brew "sdl2"
 brew "taplo"
-# Simple TTY terminal I/O application
-brew "tio"
-# Terminal multiplexer
-brew "tmux"
-# Language Server Protocol implementation for TypeScript wrapping tsserver
-brew "typescript-language-server"
-# Maintained ctags implementation
 brew "universal-ctags"
-# Language servers for HTML, CSS, JavaScript, and JSON extracted from vscode
-brew "vscode-langservers-extracted"
-# Executes a program periodically, showing output fullscreen
-brew "watch"
-# Command-line client for WebSockets
 brew "websocat"
-# Internet file retriever
-brew "wget"
-# Port of OpenAI's Whisper model in C/C++
 brew "whisper-cpp"
-# Language Server for Yaml Files
-brew "yaml-language-server"
-# Fish-like fast/unobtrusive autosuggestions for zsh
 brew "zsh-autosuggestions"
-# Fish shell like syntax highlighting for zsh
 brew "zsh-syntax-highlighting"
-# Better and friendly vi(vim) mode plugin for ZSH
 brew "zsh-vi-mode"
-# The easiest way to access your cloud.
-brew "common-fate/granted/granted"
-# Simple hotkey-daemon for macOS.
-brew "koekeishiya/formulae/skhd"
-# A tiling window manager for macOS based on binary space partitioning.
-brew "koekeishiya/formulae/yabai"
-# GPU-accelerated terminal emulator
-cask "alacritty"
-# Display management tool
-cask "betterdisplay"
-# Preference Pane for controlling cursor hiding
-cask "cursorcerer"
-# Browser for SQLite databases
-# Web browser
-cask "firefox"
-# Vector graphics editor
-cask "inkscape"
-# Open-source software for live streaming and screen recording
-cask "obs"
-# Knowledge base that works on top of a local folder of plain text Markdown files
-cask "obsidian"
-# Replacement for Docker Desktop
-cask "orbstack"
-# Administration and development platform for PostgreSQL
-cask "pgadmin4"
-# Instant messaging application focusing on security
-cask "signal"
-# Virtual audio cable for routing audio from one application to another
-cask "vb-cable"
-# Multimedia player
-cask "vlc"
+
+# LSPs
+brew "basedpyright"
+brew "bash-language-server"
+brew "gopls"
+brew "lua-language-server"
+brew "marksman"
+brew "rust-analyzer"
+brew "sql-language-server"
+brew "typescript-language-server"
+brew "vscode-langservers-extracted"
+brew "yaml-language-server"
+
+if ENV['USER_ENVIRONMENT'] == 'WORK'
+    tap "common-fate/granted"
+    brew "common-fate/granted/granted"
+    tap "heroku/brew"
+    brew "heroku"
+    brew "aws-cdk"
+    cask "pgadmin4"
+end
+
+if ENV['USER_ENVIRONMENT'] == 'HOME'
+    cask "signal"
+end
+
+if not ENV['USER_ENVIRONMENT'] == 'SERVER'
+    # Display
+    tap "koekeishiya/formulae"
+    tap "waydabber/betterdisplay"
+    brew "koekeishiya/formulae/skhd"
+    brew "koekeishiya/formulae/yabai"
+    cask "font-jetbrains-mono-nerd-font"
+    # Casks
+    cask "alacritty"
+    cask "betterdisplay"
+    cask "cursorcerer"
+    cask "firefox"
+    cask "inkscape"
+    cask "obs"
+    cask "obsidian"
+    cask "orbstack"
+    cask "vb-cable"
+    cask "vlc"
+end

+ 13 - 11
.config/brew/README.md

@@ -14,24 +14,26 @@ Homebrew (`brew`) can be installed with the following command:
 
 The [`Brewfile`](./Brewfile) describes the
 [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle) of packages
-currently installed with `brew`. It can be managed with `brew bundle`. It should
-not be managed automatically, as currently-running applications should not be
-updated.
+currently installed with `brew`. It can be managed with `brew bundle`.
 
-The `Brewfile` can be generated with the following command:
+Find installed packages absent from the `Brewfile` with the following command:
 
 ```sh
-cd $XDG_CONFIG_HOME/brew/ && brew bundle dump --force --describe
+brew bundle cleanup
 ```
 
-The content of the `Brewfile` can be installed with the following command:
+Clean up installed packages with the following command:
 
 ```sh
-cd $XDG_CONFIG_HOME/brew/ && brew bundle install
+brew bundle cleanup --force
 ```
 
-Clean up installed packages with the following command:
+## Glossary
 
-```sh
-cd $XDG_CONFIG_HOME/brew/ && brew bundle cleanup --force
-```
+- **Formula**: A package script that tells Homebrew how to install a tool.
+- **Cask**: An extension to Homebrew for installing macOS applications.
+- **Keg**: The installation directory for a particular version of a formula.
+  Kegs are located inside Homebrew's "Cellar", and Homebrew creates symlinks
+  from them to make the software accessible.
+- **Tap**: A third-party Git repository containing additional formulae not
+  included in Homebrew's main collection.

+ 1 - 0
.config/zsh/.zshenv

@@ -61,6 +61,7 @@ export PATH
 
 export HOMEBREW_NO_ANALYTICS=1
 export HOMEBREW_PREFIX="/opt/homebrew"
+export HOMEBREW_BUNDLE_FILE="$DOTFILES_DIR/.config/brew/Brewfile"
 
 ################################################################################
 # Color palette and dark mode

+ 0 - 5
.config/zsh/.zshrc

@@ -107,11 +107,6 @@ if command -v assume &>/dev/null; then;
     alias assume=". assume"
 fi;
 
-# brew
-if command -v brew &>/dev/null; then;
-    alias brewdump="(cd $XDG_CONFIG_HOME/brew/ && brew bundle dump --force --describe)"
-fi;
-
 # docker
 if command -v docker &>/dev/null; then;
     alias dockerprune="(docker system prune -a -f && docker system df -v) | less"