Skip to content

Navigation Menu

Sign in
Sign up

Commit 49a5066

Browse files
dianfishekqiclaude
andcommitted
feat: initial public dotfiles slice
Sanitized, representative slice of a personal multi-machine Nix config (t14 / devachine / MacBook-Pro / rpi3). Work and personal specifics are anonymized: the two real work contexts collapse to one generic `work`, the shared-machine second user is a generic `guest`, and only placeholder public SSH keys are committed. Secrets stay in 1Password (read at runtime). Published as a structural reference, not a turnkey config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 parents commit 49a5066

82 files changed

Lines changed: 6830 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
*.un~
2+
# Created by https://www.toptal.com/developers/gitignore/api/macos
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos
4+
5+
### macOS ###
6+
# General
7+
.DS_Store
8+
.AppleDouble
9+
.LSOverride
10+
11+
# Icon must end with two \r
12+
Icon
13+
14+
# Thumbnails
15+
._*
16+
17+
# Files that might appear in the root of a volume
18+
.DocumentRevisions-V100
19+
.fseventsd
20+
.Spotlight-V100
21+
.TemporaryItems
22+
.Trashes
23+
.VolumeIcon.icns
24+
.com.apple.timemachine.donotpresent
25+
26+
# Directories potentially created on remote AFP share
27+
.AppleDB
28+
.AppleDesktop
29+
Network Trash Folder
30+
Temporary Items
31+
.apdisk
32+
33+
### macOS Patch ###
34+
# iCloud generated files
35+
*.icloud
36+
37+
# End of https://www.toptal.com/developers/gitignore/api/macos
38+
39+
# Neovim
40+
nvim/.config/nvim/.cache/
41+
nvim/.config/nvim/Session.vim
42+
nvim/.config/nvim/.nvimlog
43+

‎.macos‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/sh
2+
3+
# Reduce Motion & Transparency
4+
defaults write com.apple.Accessibility DifferentiateWithoutColor -int 1
5+
defaults write com.apple.Accessibility ReduceMotionEnabled -int 1
6+
7+
# Disable the over-the-top focus ring animation
8+
defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
9+
10+
# Adjust toolbar title rollover delay
11+
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
12+
13+
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
14+
defaults write com.apple.finder QuitMenuItem -bool true
15+
16+
# Finder: disable window animations and Get Info animations
17+
defaults write com.apple.finder DisableAllAnimations -bool true
18+
19+
# Finder: show status bar
20+
defaults write com.apple.finder ShowStatusBar -bool true
21+
22+
# Finder: show path bar
23+
defaults write com.apple.finder ShowPathbar -bool true
24+
25+
# Display full POSIX path as Finder window title
26+
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
27+
28+
# Keep folders on top when sorting by name
29+
defaults write com.apple.finder _FXSortFoldersFirst -bool true
30+
31+
# When performing a search, search the current folder by default
32+
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
33+
34+
# Set listview as default
35+
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
36+
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
37+
38+
# Displays have seperate spaces
39+
defaults write com.apple.spaces "spans-displays" -bool "true"
40+
# Don't add period on two spaces.
41+
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
42+
43+
defaults write -g NSWindowShouldDragOnGesture -bool true
44+
45+
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
46+
47+
# Dock
48+
defaults write com.apple.dock "expose-group-apps" -bool "true"
49+
defaults write com.apple.dock "static-only" -bool "true"
50+
defaults write com.apple.dock "autohide" -bool "true"
51+
defaults write com.apple.dock "show-recents" -bool "false"
52+
53+
54+
killall SystemUIServer
55+
killall Dock
56+

‎.radare2rc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e scr.utf8 = true

‎.stow-local-ignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.*

‎.vscode/.stow-local-ignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.*

‎.vscode/extensions.json‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"recommendations": [
3+
"shakram02.bash-beautify",
4+
"ms-python.black-formatter",
5+
"streetsidesoftware.code-spell-checker",
6+
"dbaeumer.vscode-eslint",
7+
"tamasfe.even-better-toml",
8+
"github.github-vscode-theme",
9+
"eamodio.gitlens",
10+
"ms-vscode.hexeditor",
11+
"visualstudioexptteam.vscodeintellicode",
12+
"ms-toolsai.jupyter",
13+
"ms-toolsai.jupyter-keymap",
14+
"ms-toolsai.jupyter-renderers",
15+
"csstools.postcss",
16+
"esbenp.prettier-vscode",
17+
"ms-python.vscode-pylance",
18+
"ms-python.python",
19+
"ms-python.debugpy",
20+
"ms-vscode-remote.remote-ssh",
21+
"rust-lang.rust-analyzer",
22+
"nomicfoundation.hardhat-solidity",
23+
"jock.svg",
24+
"bradlc.vscode-tailwindcss",
25+
"gruntfuggly.todo-tree",
26+
"redhat.vscode-xml",
27+
"vscodevim.vim",
28+
"andenetalexander.vim-cheatsheet"
29+
]
30+
}

‎CLAUDE.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dotfiles
2+
3+
## Config management
4+
5+
This is a sanitized, public slice of a personal dotfiles repo. It uses
6+
**Nix** for configuration management: NixOS / nix-darwin for system
7+
config, with Home Manager layered in for user config. The flake
8+
(`flake.nix`) defines `nixosConfigurations` (t14, devachine, rpi3) and
9+
`darwinConfigurations` (MacBook-Pro).
10+
11+
- Per-machine system config lives in `hosts/` (e.g. `hosts/t14.nix`).
12+
- User/program config lives in `home/`; `home/default.nix` is the entry
13+
point and is assembled into the final dotfiles by Nix, not edited
14+
directly.
15+
16+
Apply changes by running the `rebuild` alias (defined per-platform in
17+
`home/darwin.nix` / `home/linux.nix`).
18+
19+
Do not manually edit files under `~/.config/` or `~/.*` that are managed
20+
by Nix — changes will be overwritten on the next rebuild. Edit the source
21+
in this repo instead.

‎README.md‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Dotfiles
2+
3+
A sanitized, representative slice of a personal multi-machine setup
4+
managed with **Nix** and **Home Manager**:
5+
6+
- **t14** — NixOS on a Lenovo ThinkPad T14 (primary laptop, Hyprland desktop)
7+
- **devachine** — a remote NixOS dev box
8+
- **MacBook-Pro** — macOS via nix-darwin (shared, light personal use)
9+
- **rpi3** — a headless Raspberry Pi 3 appliance (Home Assistant)
10+
11+
This is published as a reference for **how things are structured**, not
12+
a turnkey config. Work/personal and per-machine specifics (identities,
13+
keys, client setups) are anonymized or omitted — swap in your own. In
14+
particular, a single generic `work` context stands in for whatever real
15+
work setup you'd layer on.
16+
17+
Secrets are never committed: they are read from 1Password at runtime
18+
(`op read`). Only **public** SSH keys appear in-repo, and here they are
19+
placeholders — replace them with your own.
20+
21+
## Why this setup
22+
23+
I run this because **NixOS + LLM coding agents** is a genuinely great
24+
combination, and most of this repo is built around leaning into it:
25+
26+
- **The whole machine is declarative and in one repo.** An agent (Claude
27+
Code, Codex, the model-agnostic `pi` wrapper) can read the entire
28+
system + user config as plain text and make precise, reviewable edits —
29+
there's no hidden imperative state to reverse-engineer.
30+
- **Rebuilds are atomic and roll back.** `nixos-rebuild switch` either
31+
applies cleanly or doesn't, and every prior generation stays bootable.
32+
That makes it low-risk to let an agent touch system config: worst case
33+
you roll back a generation.
34+
- **Reproducible, so changes behave the same everywhere** — what an agent
35+
does on the t14 lands identically on the devachine. Per-project `nix` +
36+
`direnv` dev shells give agents hermetic, declared toolchains instead of
37+
"works on my machine."
38+
- **The LLM tooling itself is Nix-managed** — isolated per-account Claude
39+
Code configs (`~/.claude-dian`, `~/.claude-work`), Codex, and `pi` are
40+
all defined here and rebuilt declaratively, so the agent setup is as
41+
reproducible as everything else.
42+
43+
## Apply config
44+
45+
NixOS hosts:
46+
47+
```bash
48+
nixos-rebuild switch --flake .#t14
49+
```
50+
51+
macOS:
52+
53+
```bash
54+
darwin-rebuild switch --flake .#MacBook-Pro
55+
```
56+
57+
Both are wrapped by a per-platform `rebuild` alias (defined in
58+
`home/darwin.nix` / `home/linux.nix`).
59+
60+
## Layout
61+
62+
- `flake.nix` — defines every machine's `nixosConfigurations` /
63+
`darwinConfigurations`.
64+
- `hosts/` — per-machine system config (e.g. `hosts/t14.nix`).
65+
- `home/` — user/program config; `home/common.nix` holds most program
66+
configuration shared across machines, with `home/linux.nix` /
67+
`home/darwin.nix` / `home/dev-packages.nix` layered per platform.
68+
- `zsh/`, `nvim/`, `ghostty/`, `aerospace/`, etc. — source files
69+
symlinked or copied into place by Nix.
70+
71+
## Notes
72+
73+
- Do not edit files under `~/.config/` or `~/.*` that are Nix-managed —
74+
they'll be overwritten on rebuild. Edit the source in this repo instead.

‎aerospace/.aerospace.toml‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
start-at-login = true
2+
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
3+
automatically-unhide-macos-hidden-apps = true
4+
5+
[mode.main.binding]
6+
alt-shift-c = 'reload-config' # Reload config
7+
cmd-h = [] # Disable "hide application"
8+
cmd-alt-h = [] # Disable "hide others"
9+
10+
alt-h = 'focus --boundaries-action wrap-around-the-workspace left'
11+
alt-j = 'focus --boundaries-action wrap-around-the-workspace down'
12+
alt-k = 'focus --boundaries-action wrap-around-the-workspace up'
13+
alt-l = 'focus --boundaries-action wrap-around-the-workspace right'
14+
15+
alt-shift-h = 'move left'
16+
alt-shift-j = 'move down'
17+
alt-shift-k = 'move up'
18+
alt-shift-l = 'move right'
19+
20+
alt-f = 'fullscreen'
21+
alt-s = 'layout tiles horizontal vertical' # 'layout toggle split' in i3
22+
alt-shift-space = 'layout floating tiling' # 'floating toggle' in i3
23+
alt-r = 'mode resize'
24+
25+
26+
## Workspace related
27+
# Browser
28+
alt-w = 'workspace W'
29+
alt-shift-w = 'move-node-to-workspace W'
30+
31+
# Editor
32+
alt-e = 'workspace E'
33+
alt-shift-e = 'move-node-to-workspace E'
34+
35+
alt-i = 'workspace I'
36+
alt-shift-i = 'move-node-to-workspace I'
37+
cmd-space = '''exec-and-forget ls /Applications/ /Applications/Utilities/ /System/Applications/ /System/Applications/Utilities/ | grep '\.app$' | sed 's/\.app$//g' | choose | xargs -I {} open -a "{}.app" '''
38+
alt-enter = '''exec-and-forget osascript -e 'tell application "Ghostty" to activate' '''
39+
40+
alt-shift-enter = [ 'exec-and-forget open -na "Chromium"']
41+
42+
alt-v = 'workspace V'
43+
alt-shift-v = 'move-node-to-workspace V'
44+
45+
alt-1 = 'workspace 1'
46+
alt-2 = 'workspace 2'
47+
alt-3 = 'workspace 3'
48+
alt-4 = 'workspace 4'
49+
alt-5 = 'workspace 5'
50+
alt-6 = 'workspace 6'
51+
alt-7 = 'workspace 7'
52+
alt-8 = 'workspace 8'
53+
alt-9 = 'workspace 9'
54+
alt-0 = 'workspace 10'
55+
56+
alt-shift-1 = 'move-node-to-workspace 1'
57+
alt-shift-2 = 'move-node-to-workspace 2'
58+
alt-shift-3 = 'move-node-to-workspace 3'
59+
alt-shift-4 = 'move-node-to-workspace 4'
60+
alt-shift-5 = 'move-node-to-workspace 5'
61+
alt-shift-6 = 'move-node-to-workspace 6'
62+
alt-shift-7 = 'move-node-to-workspace 7'
63+
alt-shift-8 = 'move-node-to-workspace 8'
64+
alt-shift-9 = 'move-node-to-workspace 9'
65+
alt-shift-0 = 'move-node-to-workspace 10'
66+
67+
68+
[[on-window-detected]]
69+
if.app-id = 'dev.zed.Zed'
70+
run = 'move-node-to-workspace E'
71+
72+
[[on-window-detected]]
73+
if.app-id = 'com.microsoft.VSCode'
74+
run = 'move-node-to-workspace E'
75+
76+
[[on-window-detected]]
77+
if.app-id = 'com.mitchellh.ghostty'
78+
run = 'move-node-to-workspace I'
79+
80+
[[on-window-detected]]
81+
if.app-id = 'org.chromium.Chromium'
82+
run = 'move-node-to-workspace W'
83+
84+
85+
[workspace-to-monitor-force-assignment]
86+
W = 'main'
87+
I = 'main'
88+
E = 'built-in'
89+
V = 'LF27T450F'
90+
91+
[mode.resize.binding]
92+
j = 'resize smart +50'
93+
k = 'resize smart -50'
94+
enter = 'mode main'
95+
esc = 'mode main'

‎chrome/policies.nix‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
let
2+
common = {
3+
AIModeSettings = 1;
4+
AutofillPredictionSettings = 2;
5+
AutomatedPasswordChangeSettings = 2;
6+
CreateThemesSettings = 2;
7+
DevToolsGenAiSettings = 2;
8+
GeminiActOnWebSettings = 1;
9+
GenAILocalFoundationalModelSettings = 1;
10+
HelpMeWriteSettings = 2;
11+
HistorySearchSettings = 2;
12+
LensOverlaySettings = 1;
13+
SearchContentSharingSettings = 1;
14+
TabCompareSettings = 2;
15+
16+
DomainReliabilityAllowed = false;
17+
MetricsReportingEnabled = false;
18+
SafeBrowsingExtendedReportingEnabled = false;
19+
UrlKeyedAnonymizedDataCollectionEnabled = false;
20+
21+
PrivacySandboxAdMeasurementEnabled = false;
22+
PrivacySandboxAdTopicsEnabled = false;
23+
PrivacySandboxPromptEnabled = false;
24+
PrivacySandboxSiteEnabledAdsEnabled = false;
25+
};
26+
in {
27+
inherit common;
28+
29+
darwin = common // {
30+
GeminiSettings = 1;
31+
};
32+
33+
linux = common;
34+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /