Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Watch the walkthrough: https://youtu.be/5N-okeDdIuI
My personal Mac setup, managed with nix-darwin and home-manager.
One repo, one command, and a fresh Mac ends up configured the same way every time.

nix-darwin manages macOS level packages. home-manager manages home folder settings.

> This is a fork of https://github.com/kunchenguid/dotfiles to add my own tooling around vscode, language servers, local models, and other development needs.

## Contributing / Using This Repo

These are my personal dotfiles, shared publicly so people can read them, learn from them, and fork them freely.
Expand Down
22 changes: 19 additions & 3 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
AppleInterfaceStyle = "Dark";
KeyRepeat = 2; # fast key repeat
InitialKeyRepeat = 15; # short delay before repeat
_HIHideMenuBar = true; # auto-hide the menu bar
# _HIHideMenuBar = true; # auto-hide the top menu
AppleShowAllExtensions = true;
};
dock.autohide = true;
Expand All @@ -35,11 +35,27 @@
onActivation.autoUpdate = true;
onActivation.extraFlags = [ "--force" ];
brews = [
"herdr"
"herdr" # tmux for agents
"gh" # GitHub CLI
"ca-certificates" # required for node
"node"
"go"

# Common shell / systems tools
"wget"
"curl"
"cloc" # lines of code and other metadata for a repo
"ncdu" # disk space usage cli scanner
"jq" # json parsing
];
casks = [
"wezterm"
"wezterm" # replaces zsh as our terminal of choice
"claude-code"
"lm-studio" # run local models
"sublime-text" # default text editor
"rectangle" # window management
"handy" # local speech-to-text using Whisper or Parakeet models
"stats" # CPU / Memory / swap usage while runing local models
];
};
}
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";

nix-homebrew.url = "github:zhaofengli/nix-homebrew";

treehouse = {
url = "github:kunchenguid/treehouse";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nix-darwin, nix-homebrew, home-manager, nixpkgs }:
outputs = inputs@{ self, nix-darwin, nix-homebrew, home-manager, nixpkgs, treehouse }:
let
# The one username line to change if this isn't your machine.
# bootstrap.sh offers to rewrite this for you if your macOS username differs.
user = "kunchen";
user = "owner";
in
{
darwinConfigurations."mac" = nix-darwin.lib.darwinSystem {
Expand All @@ -30,7 +35,7 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.extraSpecialArgs = { inherit user treehouse; };
home-manager.users.${user} = import ./home.nix;
}
];
Expand Down
53 changes: 52 additions & 1 deletion home.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{ config, pkgs, user, ... }:
{ config, pkgs, user, treehouse, lib, ... }:

let
dotfiles = "${config.home.homeDirectory}/.dotfiles";
in

{
imports = [ ./vscode.nix ];

home.username = user;
home.homeDirectory = "/Users/${user}";
home.stateVersion = "24.11";
Expand All @@ -16,8 +18,11 @@ in
jq # json on the command line
lazygit
neovim
# vscode + its extensions live in ./vscode.nix
# the font everything renders in
nerd-fonts.hack
# treehouse install
treehouse.packages.${pkgs.system}.default
];
fonts.fontconfig.enable = true;
home.sessionVariables.EDITOR = "nvim";
Expand All @@ -37,6 +42,10 @@ in
m = "git switch main";
cc = "claude --dangerously-skip-permissions";
co = "codex --full-auto";
server = "python3 -m http.server 8080";
# run models all night / clamshell without letting the computer sleep
preventsleep = "sudo pmset -b sleep 0; sudo pmset -b disablesleep 1";
enablesleep = "sudo pmset -b sleep 30; sudo pmset -b disablesleep 0";
};
};

Expand Down Expand Up @@ -79,4 +88,46 @@ in
config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";
home.file.".config/opencode/AGENTS.md".source =
config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";

# VSCode
home.file."Library/Application Support/Code/User/settings.json".source =
config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.vscode/settings.json";


# we're using nix to install homebrew, then homebrew to install nodejs/npm so
# that we can keep it updated easier than relying on the nix packages.
# However, that means we must install the packages ourselves and homebrew
# doesn't have packages for all of them (neither does nix actually) so...
# ...here we are with a hacky post-install script.
home.activation.installNpmPackages = lib.hm.dag.entryAfter ["writeBoundary"] ''
BREW_BIN="/opt/homebrew/bin"
NODE_PATH="$BREW_BIN/node"
NPM_PATH="$BREW_BIN/npm"
NPX_PATH="$BREW_BIN/npx"

if [ -x "$NPM_PATH" ]; then
export PATH="$BREW_BIN:$PATH"

# export NPM_CONFIG_PREFIX="${config.home.homeDirectory}/.npm-global"
# mkdir -p "$NPM_CONFIG_PREFIX"

echo "Installing global npm packages via Homebrew Node..."
$DRY_RUN_CMD "$NPM_PATH" install -g skills gh-axi chrome-devtools-axi gnhf
else
echo "Warning: Homebrew npm not found at $NPM_PATH yet. Skipping."
fi

if [ -x "$NPX_PATH" ]; then
export PATH="$BREW_BIN:$PATH"
$DRY_RUN_CMD "$NPX_PATH" skills add kunchenguid/lavish-axi --skill lavish

# report installed skills
"$NPX_PATH" skills list -g
else
echo "Warning: Homebrew npx not found at $NPX_PATH yet. Skipping."
fi

# also install the no-mistakes binary
$DRY_RUN_CMD go install github.com/kunchenguid/no-mistakes/cmd/no-mistakes@latest
'';
}
1 change: 1 addition & 0 deletions home/.config/nvim/lua/plugins/navigation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ return {
},
}

-- Explaination: https://youtu.be/5N-okeDdIuI?t=1475
51 changes: 51 additions & 0 deletions home/.config/wezterm/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,55 @@ wezterm.on("window-focus-changed", function(window)
window:set_config_overrides(overrides)
end)

-- Function to get memory usage based on OS
local function get_memory_usage()
local cmd = ""

if wezterm.target_triple:find("apple") then
-- macOS command
cmd = [[
vm_stat | awk '
/Pages free/ {free=$3}
/Pages active/ {a=$3}
/Pages inactive/ {i=$3}
/Pages speculative/ {s=$3}
/Pages wired down/ {w=$3}
END {
used=a+i+s+w;
total=used+free;
if (total==0) { print "N/A"; exit 1 }
printf "%.1f%%", (used/total)*100
}'
]]
elseif wezterm.target_triple:find("windows") then
-- Windows PowerShell command
cmd = "powershell -NoProfile -Command \"(Get-CimInstance Win32_OperatingSystem).FreePhysicalMemory\""
else
-- Linux command
cmd = "free -h | awk '/^Mem:/ {print $3 \"/\" $2}'"
end

local success, stdout, stderr = wezterm.run_child_process({ "sh", "-c", cmd })

-- Fallback for Windows if sh isn't available natively
if not success and wezterm.target_triple:find("windows") then
success, stdout, stderr = wezterm.run_child_process({ "powershell.exe", "-NoProfile", "-Command", cmd })
end

if success then
return stdout:gsub("%s+", "") -- Clean up whitespace/newlines
end
return "Mem: Unknown"
end

wezterm.on('update-status', function(window, pane)
local mem = get_memory_usage()

window:set_right_status(wezterm.format({
{ Background = { Color = '#1e1e2e' } },
{ Foreground = { Color = '#fab387' } },
{ Text = ' Mem: ' .. mem .. ' ' },
}))
end)

return config
9 changes: 9 additions & 0 deletions home/.pi/agent/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
"contextWindow": 272000
}
}
},
"lmstuido": {
"baseUrl": "http://127.0.0.1:1234/v1",
"api": "openai-completions",
"apiKey": "lmstudio",
"models": [
{ "id": "qwen/qwen3.6-35b-a3b" },
{ "id": "qwen/qwen3.6-27b" }
]
}
}
}
30 changes: 30 additions & 0 deletions home/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"go.toolsManagement.autoUpdate": true,
"go.testTags": "",
"go.testOnSave": true,
"go.testFlags": ["-v"],
"go.formatTool": "goimports",
"go.lintTool": "golint",
"go.lintFlags": [],
"go.useLanguageServer": true,
"go.languageServerFlags": ["-rpc.trace"],
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports":"explicit",
"source.fixAll":"explicit"
}
},
"editor.rulers": [80, 120],
"workbench.settings.applyToAllProfiles": [],
"claudeCode.preferredLocation": "panel",
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 80,
"[html]": {
"editor.wordWrapColumn": 80
},
"settingsSync.ignoredSettings": [

],
"[c]": {}
}
18 changes: 18 additions & 0 deletions vscode.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# VSCode plus its extensions, installed from nixpkgs like every other package.
# Kept in its own file so editor/extension changes are easy to find and edit.
{ pkgs, ... }:

{
home.packages = [
(pkgs.vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions; [
golang.go # Go language support
rust-lang.rust-analyzer # Rust language server
ms-python.vscode-pylance # Python language server (unfree)
saoudrizwan.claude-dev # Cline for local agents
shd101wyy.markdown-preview-enhanced
jnoortheen.nix-ide # nix language server
];
})
];
}