Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,5 @@ nvim_issue
stow/shared/.config/zed/prompts
stow/Darwin/Library/Application Support/lazygit/state.yml

# npm-tools installed packages (lockfile bun.lockb IS tracked)
npm-tools/node_modules/

# Runtime symlink created by stow/shared/.claude-web/web-setup.sh on the web sandbox
/.claude
11 changes: 5 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Example locations:

### Package-Managed Tools (npm and Python)

For CLI tools installed via bun (npm) or uv (Python). Unlike self-managed CLIs,
these require explicit upgrades via `./rebuild.sh --update-unstable` or
For CLI tools installed via deno (npm) or uv (Python). Unlike self-managed
CLIs, these require explicit upgrades via `./rebuild.sh --update-unstable` or
`--update`.

- **Module**: `nix/shared/home/package-tools.nix`
Expand All @@ -89,9 +89,10 @@ these require explicit upgrades via `./rebuild.sh --update-unstable` or

**Adding npm tools:**

1. Add the package to `packageTools.npmPackages` in the appropriate Nix config
1. Add a `{ package, bin }` entry to `packageTools.npmPackages` in the
appropriate Nix config (`bin` is the package.json "bin" name)
2. Run `./rebuild.sh` to install
3. Update later: `./rebuild.sh --update-unstable` or `bun update -g`
3. Update later: `./rebuild.sh --update-unstable` or `npm-tools-upgrade`

**Adding Python CLI tools (via uv):**

Expand Down Expand Up @@ -146,8 +147,6 @@ For each language, consult the corresponding file in

## Gotchas

- **npm packages are macOS-only**: `packageTools.npmPackages` has dynamic
linking issues on NixOS — only add npm tools in Darwin configs
- **Neovim is managed by Bob**, not nixpkgs — binary is at
`~/.local/share/bob/nvim-bin/nvim`
- **`stow/` changes take effect immediately** (just re-run
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ symlinking.
# Rebuild system + packages + dotfiles (reproducible, uses flake.lock)
./rebuild.sh

# Update ALL flake inputs + upgrade uv tools + upgrade bun packages
# Update ALL flake inputs + upgrade uv tools + upgrade npm tools
./rebuild.sh --update

# Update unstable inputs + upgrade uv tools + upgrade bun packages
# Update unstable inputs + upgrade uv tools + upgrade npm tools
./rebuild.sh --update-unstable

# Dotfiles only (no Nix rebuild)
Expand Down
4 changes: 2 additions & 2 deletions extras/README_NIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin -- sw
| User packages | home-manager | Per-user | `nix/shared/home/` |
| User preferences | home-manager | Per-user | `nix/shared/home/` + host-specific |
| Self-managed CLIs | Native installers (curl/wget) | Per-user | `nix/shared/home/self-managed-clis.nix` |
| Package tools | bun (npm), uv (Python) | Per-user | `nix/shared/home/package-tools.nix` |
| Package tools | deno (npm), uv (Python) | Per-user | `nix/shared/home/package-tools.nix` |
| Host configuration | nix-darwin/NixOS | System-wide | `nix/hosts/*/configuration.nix` |
| System packages | nix-darwin/NixOS | System-wide | `nix/shared/system/` |
| System settings | nix-darwin/NixOS | System-wide | `nix/shared/system/` |
Expand Down Expand Up @@ -150,7 +150,7 @@ By default, `./rebuild.sh` aims to be "reproducible" and uses the locked
`--update` to update all inputs.

```sh
# Update unstable/Darwin-related inputs + upgrade uv tools + upgrade bun packages
# Update unstable/Darwin-related inputs + upgrade uv tools + upgrade npm tools
./rebuild.sh --update-unstable
# Or manually (flake inputs only): nix flake update nixpkgs-unstable nix-darwin home-manager-unstable dotfiles

Expand Down
141 changes: 135 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@
# stable.${system}.xxx

# Unstable packages
unstable.${system}.bun
unstable.${system}.deno
unstable.${system}.go_latest
unstable.${system}.nodejs
unstable.${system}.pnpm
unstable.${system}.python3
unstable.${system}.ruby
];
shellHook = ''
echo -e "\033[32m[dotfiles-toolchain] bun $(bun --version) | $(go version | awk '{print $1" "$3}') | lua $(lua -v 2>&1 | awk '{print $2}') | node $(node -v) (npm $(npm -v)) | pnpm $(pnpm -v) | python $(python --version | awk '{print $2}') | $(ruby -v | cut -d' ' -f1-2)\033[0m"
echo -e "\033[32m[dotfiles-toolchain] $(deno --version | awk 'NR==1{print $1" "$2}') | $(go version | awk '{print $1" "$3}') | lua $(lua -v 2>&1 | awk '{print $2}') | node $(node -v) (npm $(npm -v)) | pnpm $(pnpm -v) | python $(python --version | awk '{print $2}') | $(ruby -v | cut -d' ' -f1-2)\033[0m"
'';
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/hosts/plumbus/users/fredrik.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ in

# plumbus-specific package-managed tools
packageTools.npmPackages = [
"@googleworkspace/cli"
{
package = "@googleworkspace/cli";
bin = "gws";
}
];
packageTools.uvTools = [ ];

Expand Down
5 changes: 4 additions & 1 deletion nix/hosts/zap/users/fredrik.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ in

# zap-specific package-managed tools
packageTools.npmPackages = [
"@googleworkspace/cli"
{
package = "@googleworkspace/cli";
bin = "gws";
}
];
packageTools.uvTools = [ ];

Expand Down
21 changes: 11 additions & 10 deletions nix/shared/home/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ in
# Self-managed CLI tools (installed once, auto-update thereafter)
selfManagedCLIs.clis = [
(mkCurlInstaller "claude" "Claude Code" "https://claude.ai/install.sh" "$HOME/.local/bin/claude")
(mkCurlInstaller "agent" "Cursor Agent" "https://cursor.com/install" "$HOME/.local/bin/agent")
# (mkCurlInstaller "agent" "Cursor Agent" "https://cursor.com/install" "$HOME/.local/bin/agent")
# (mkCurlInstaller "vibe" "Mistral Vibe" "https://mistral.ai/vibe/install.sh" "$HOME/.local/bin/vibe")
# (mkCurlInstaller "agy" "Antigravity CLI" "https://antigravity.google/cli/install.sh"
# "$HOME/.local/bin/agy"
Expand All @@ -54,10 +54,10 @@ in
'' "$HOME/.opencode/bin/opencode")
];

# npm packages via bun (macOS only, mergeable across config levels)
# npm packages (mergeable across config levels)
packageTools.npmPackages = [ ];

# Python CLI tools via uv (mergeable across config levels)
# Python CLI tools (mergeable across config levels)
packageTools.uvTools = [
{
package = "sqlit-tui";
Expand Down Expand Up @@ -143,6 +143,11 @@ in
# ========================================================================
# Language-specific
uv
# Deno installs/runs the npm-managed CLI tools. Unlike node/bun global
# installs (FHS shebangs, glibc-linked shims), deno shims are /bin/sh
# scripts exec'ing the nix store deno -> works on NixOS. Unstable for
# the latest Node-compat fixes (no-op on macOS, where pkgs IS unstable).
unstable.deno

# Generic development
bfs
Expand All @@ -152,7 +157,6 @@ in
dust
fd
gnumake
go-task
# pre-commit # requires swift, which is problematic and very expensive to build on macOS
ripgrep
ugrep
Expand Down Expand Up @@ -185,11 +189,9 @@ in
slides
chafa # Required for showing images in slides

# AI coding agents from the llm-agents flake input (see flake.nix).
# Update via `./rebuild.sh --update-unstable` (or --update).
llmAgents.codex # @openai/codex
llmAgents.gemini-cli # @google/gemini-cli
llmAgents.pi # @earendil-works/pi-coding-agent
llmAgents.codex
llmAgents.gemini-cli
llmAgents.pi

# ========================================================================
# Infrastructure & Cloud
Expand All @@ -209,7 +211,6 @@ in
home.file.".config/nvim-deps-path".text = lib.makeBinPath (
with unstable;
[
bun
cmake
beamPackages.elixir
gcc
Expand Down
Loading
Loading