mirror of
https://github.com/awatertrevi/macos-configuration.git
synced 2026-10-07 11:27:35 +00:00
updates
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
# macOS Configuration
|
||||||
|
|
||||||
|
Personal macOS setup and configuration files.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
### 1. Install Homebrew
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Install packages and apps
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew bundle --file=brewfile
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Symlink configuration files
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ln -sf $(pwd)/fish-config.fish ~/.config/fish/config.fish
|
||||||
|
ln -sf $(pwd)/starship.toml ~/.config/starship.toml
|
||||||
|
ln -sf $(pwd)/ssh-config ~/.ssh/config
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Set Fish as default shell
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo /opt/homebrew/bin/fish | sudo tee -a /etc/shells
|
||||||
|
chsh -s /opt/homebrew/bin/fish
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Configure iTerm2
|
||||||
|
|
||||||
|
Import `iterm-profile.json` via iTerm2 preferences. Uses 1Password SSH agent for key management.
|
||||||
|
|
||||||
|
## Scripts
|
||||||
|
|
||||||
|
### clone-resoftware-repos.fish
|
||||||
|
|
||||||
|
Clones all repositories from the `resoftware` GitHub organization, organized by customer number:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fish clone-resoftware-repos.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
Repos are cloned via SSH into `~/Repositories/{customer-number}/{repo-name}` based on each repo's `customer-number` custom property. Safe to re-run -- already cloned repos are skipped.
|
||||||
|
|
||||||
|
## Updating the Brewfile
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew bundle dump --file=brewfile --force
|
||||||
|
```
|
||||||
@@ -16,11 +16,13 @@ cask "docker-desktop"
|
|||||||
cask "font-fira-code-nerd-font"
|
cask "font-fira-code-nerd-font"
|
||||||
cask "fork"
|
cask "fork"
|
||||||
cask "google-drive"
|
cask "google-drive"
|
||||||
|
cask "home-assistant"
|
||||||
cask "iterm2"
|
cask "iterm2"
|
||||||
cask "jetbrains-toolbox"
|
cask "jetbrains-toolbox"
|
||||||
cask "lens"
|
cask "lens"
|
||||||
cask "mos"
|
cask "mos"
|
||||||
cask "obsidian"
|
cask "obsidian"
|
||||||
|
cask "openinterminal"
|
||||||
cask "readdle-spark"
|
cask "readdle-spark"
|
||||||
cask "slack"
|
cask "slack"
|
||||||
cask "spotify"
|
cask "spotify"
|
||||||
|
|||||||
Executable
+70
@@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
set base_dir ~/Repositories
|
||||||
|
set org resoftware
|
||||||
|
|
||||||
|
set cloned 0
|
||||||
|
set skipped 0
|
||||||
|
set warnings 0
|
||||||
|
|
||||||
|
echo "Fetching repositories and custom properties for $org..."
|
||||||
|
|
||||||
|
set json (gh api "orgs/$org/properties/values" --paginate)
|
||||||
|
|
||||||
|
if test $status -ne 0
|
||||||
|
echo "Error: Failed to fetch repository properties from GitHub."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set repo_lines (echo $json | python3 -c "
|
||||||
|
import json, sys
|
||||||
|
data = json.load(sys.stdin)
|
||||||
|
for repo in data:
|
||||||
|
name = repo['repository_name']
|
||||||
|
full_name = repo['repository_full_name']
|
||||||
|
customer = ''
|
||||||
|
for prop in repo.get('properties', []):
|
||||||
|
if prop['property_name'] == 'customer-number':
|
||||||
|
customer = prop.get('value', '') or ''
|
||||||
|
break
|
||||||
|
print(f'{name}\t{full_name}\t{customer}')
|
||||||
|
")
|
||||||
|
|
||||||
|
if test $status -ne 0
|
||||||
|
echo "Error: Failed to parse repository data."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for line in $repo_lines
|
||||||
|
set parts (string split \t $line)
|
||||||
|
set repo_name $parts[1]
|
||||||
|
set full_name $parts[2]
|
||||||
|
set customer $parts[3]
|
||||||
|
|
||||||
|
if test -z "$customer"
|
||||||
|
echo "Warning: $full_name has no customer-number property, skipping."
|
||||||
|
set warnings (math $warnings + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
set target_dir "$base_dir/$customer/$repo_name"
|
||||||
|
|
||||||
|
if test -d "$target_dir"
|
||||||
|
echo "Skipping $full_name (already exists at $target_dir)"
|
||||||
|
set skipped (math $skipped + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
echo "Cloning $full_name into $target_dir..."
|
||||||
|
mkdir -p (dirname "$target_dir")
|
||||||
|
git clone "[email protected]:$full_name.git" "$target_dir"
|
||||||
|
|
||||||
|
if test $status -eq 0
|
||||||
|
set cloned (math $cloned + 1)
|
||||||
|
else
|
||||||
|
echo "Error: Failed to clone $full_name"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Done! Cloned: $cloned, Skipped: $skipped, Warnings: $warnings"
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[Interface]
|
||||||
|
PrivateKey = GMopfBHSJkM00xrF6TUyBFiBzkcre7VxIrl3250AXk4=
|
||||||
|
Address = 192.168.178.203/24,fd65:e9a5:9f09::203/64
|
||||||
|
DNS = 192.168.178.1,fd65:e9a5:9f09::2e3a:fdff:feeb:343a
|
||||||
|
DNS = fritz.box
|
||||||
|
|
||||||
|
[Peer]
|
||||||
|
PublicKey = MpQ+8UUqsSMWv3tFCvLqapYXnGCcc0r9eHAQHShZfD0=
|
||||||
|
PresharedKey = gHwRKA0ftc2Mhp3bQHUYRL3NtJu0sG1EBehXAO0Fl6E=
|
||||||
|
AllowedIPs = 192.168.178.0/24,0.0.0.0/0,fd65:e9a5:9f09::/64,::/0
|
||||||
|
Endpoint = ybmf6ge2fvmqxz3k.myfritz.net:59411
|
||||||
|
PersistentKeepalive = 25
|
||||||
Reference in New Issue
Block a user