Skip to content
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
140 changes: 75 additions & 65 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,44 +190,38 @@ services: ## Restart platform-specific services (launchd on macOS, systemd on Li
$(MAKE) systemctl; \
fi

.PHONY: dotagents-sync
dotagents-sync: ## Sync dotagents (commands, skills, MCP configuration).
@$(MAKE) -C dotagents sync

.PHONY: test
test: neovim-test nix-test shell-test python-test shell-inline-check ## Run all tests (neovim + nix + shell + python + shell-inline-check).

##@ Update

.PHONY: update
update: update-local-binaries ## Update local binaries
##@ Dev
.PHONY: dev
dev: nix-develop ## Enter the Nix dev shell (alias for nix-develop).

.PHONY: update-local-binaries
update-local-binaries: ## Update and rebuild local binaries from .local-binaries.txt.
@echo "🔄 Updating local binaries..."
@if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ]; then \
echo "⏭️ Skipping local binaries update in CI/Docker"; \
else \
./scripts/update-local-binaries.sh; \
fi
.PHONY: nix-develop
nix-develop: ## Enter the Nix development shell.
DEVENV_ROOT=$(CURDIR) $(NIX_ALLOW_UNFREE) $(NIX_EXEC) develop $(NIX_FLAGS)

.PHONY: devenv-cli
devenv-cli: ## Build the packaged devenv CLI binary.
@echo "📦 Building packaged devenv CLI..."
@$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#devenv-cli $(NIX_FLAGS) --show-trace
@echo "✅ devenv CLI available in ./result/bin/devenv"

##@ Upgrade

.PHONY: upgrade
upgrade: nix-upgrade overlays-upgrade neovim-upgrade llm-upgrade gitalias-upgrade codex-security-sync rtk-rewrite-sync ## Upgrade Nix flake, overlays, Neovim plugins, LLM configs, and gitalias
upgrade: sync update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The upgrade target now depends on a sync target, but sync is not defined anywhere in the Makefile. This will cause make upgrade to fail with an error: make: *** No rule to make target 'sync'. Stop.

You should define a sync target that aggregates the individual sync commands (e.g., dotagents-sync, codex-security-sync, rtk-rewrite-sync).

Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved

.PHONY: llm-upgrade
llm-upgrade: ## Regenerate tool configs from models.json.
@echo "🤖 Updating LLM tool configs..."
@./scripts/llm-update.sh
@echo "✅ LLM configs updated"
.PHONY: upgrade-dev
upgrade-dev: ## Upgrade inside the Nix dev shell (mirrors CI).
@echo "🔄 Running upgrade inside the Nix dev shell..."
@DEVENV_ROOT=$(CURDIR) $(NIX_ALLOW_UNFREE) $(NIX_EXEC) develop $(NIX_FLAGS) .# --command $(MAKE) upgrade

.PHONY: gitalias-upgrade
gitalias-upgrade: ## Download latest gitalias.txt from upstream.
@echo "📥 Updating gitalias.txt..."
@./scripts/update-gitalias.sh
@echo "✅ gitalias.txt updated"
##@ Sync

.PHONY: dotagents-sync
dotagents-sync: ## Sync dotagents (commands, skills, MCP configuration).
@$(MAKE) -C dotagents sync

.PHONY: codex-security-sync
codex-security-sync: ## Sync Codex security deny patterns from Claude settings.
Expand All @@ -241,13 +235,22 @@ rtk-rewrite-sync: ## Sync rtk-rewrite.sh from upstream rtk repo.
@./scripts/sync-rtk-rewrite.sh
@echo "✅ rtk-rewrite.sh synced"

.PHONY: upgrade-dev
upgrade-dev: ## Upgrade inside the Nix dev shell (mirrors CI).
@echo "🔄 Running upgrade inside the Nix dev shell..."
@DEVENV_ROOT=$(CURDIR) $(NIX_ALLOW_UNFREE) $(NIX_EXEC) develop $(NIX_FLAGS) .# --command $(MAKE) upgrade
##@ Update

.PHONY: dev
dev: nix-develop ## Enter the Nix dev shell (alias for nix-develop).
.PHONY: uptate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in the .PHONY declaration: uptate should be update.

.PHONY: update

Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the phony declaration: .PHONY: uptate means update is not marked phony, so make update may be skipped if a file named update exists. Rename uptate to update in the .PHONY line.

Suggested change
.PHONY: uptate
.PHONY: update

Copilot uses AI. Check for mistakes.
update: nix-update overlays-update neovim-update llm-update gitalias-update ## Update Nix flake, overlays, Neovim plugins, LLM configs, and gitalias
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

.PHONY: llm-update
llm-update: ## Regenerate tool configs from models.json.
@echo "🤖 Updating LLM tool configs..."
@./scripts/llm-update.sh
@echo "✅ LLM configs updated"

.PHONY: gitalias-update
gitalias-update: ## Download latest gitalias.txt from upstream.
@echo "📥 Updating gitalias.txt..."
@./scripts/update-gitalias.sh
@echo "✅ gitalias.txt updated"

##@ Nix Setup

Expand All @@ -258,8 +261,17 @@ nix-setup: nix-install nix-check nix-connect ## Set up Nix environment (install,
nix-connect: ## Ensure Nix daemon is running.
@echo "🔌 Ensuring Nix daemon is running for $(NIX_CONFIG_TYPE) on $(OS) $(ARCH) for USER=$(NIX_USERNAME)"
@if [ "$(OS)" = "Darwin" ]; then \
$(SUDO) launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist 2>/dev/null || true; \
$(SUDO) launchctl load -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist; \
if nix store info >/dev/null 2>&1; then \
echo "✅ Nix daemon is already reachable. Skipping restart."; \
elif [ -f /Library/LaunchDaemons/systems.determinate.nix-daemon.plist ]; then \
$(SUDO) launchctl bootout system/systems.determinate.nix-daemon 2>/dev/null || true; \
$(SUDO) launchctl bootstrap system /Library/LaunchDaemons/systems.determinate.nix-daemon.plist; \
elif [ -f /Library/LaunchDaemons/org.nixos.nix-daemon.plist ]; then \
$(SUDO) launchctl bootout system/org.nixos.nix-daemon 2>/dev/null || true; \
$(SUDO) launchctl bootstrap system /Library/LaunchDaemons/org.nixos.nix-daemon.plist; \
else \
echo "❌ No Nix daemon plist found"; exit 1; \
fi; \
elif [ "$(OS)" = "Linux" ]; then \
if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ] || [ "$$AUTOMATED_UPDATE" = "true" ]; then \
echo "🏃‍♂️ Nix daemon management (e.g., systemctl) is skipped in CI/Docker/automated environments."; \
Expand Down Expand Up @@ -299,16 +311,6 @@ nix-check: ## Verify Nix environment setup.
fi
@echo "✅ Nix environment found!"

.PHONY: nix-develop
nix-develop: ## Enter the Nix development shell.
DEVENV_ROOT=$(CURDIR) $(NIX_ALLOW_UNFREE) $(NIX_EXEC) develop $(NIX_FLAGS)

.PHONY: devenv-cli
devenv-cli: ## Build the packaged devenv CLI binary.
@echo "📦 Building packaged devenv CLI..."
@$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#devenv-cli $(NIX_FLAGS) --show-trace
@echo "✅ devenv CLI available in ./result/bin/devenv"

.PHONY: nix-install
nix-install: ## Install Nix if not already installed.
@if [ "$(NIX_ENV)" = "not_found" ]; then \
Expand All @@ -319,8 +321,8 @@ nix-install: ## Install Nix if not already installed.

##@ Nix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The help comment for nix-update is outdated. It still mentions "build, and switch", but the target now only performs nix-daemon-update and nix-flake-update. Additionally, note that nix-update no longer triggers a system switch, which is a significant change from the previous nix-upgrade behavior.

nix-update: nix-daemon-update nix-flake-update ## Update Nix daemon and flake lock file.

.PHONY: nix-upgrade
nix-upgrade: nix-flake-upgrade nix-build nix-switch ## Upgrade Nix flake, build, and switch.
.PHONY: nix-update
nix-update: nix-connect nix-daemon-update nix-flake-update ## Upgrade Nix flake, build, and switch.

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target comment is inaccurate: nix-update no longer depends on nix-build and nix-switch, but the description still says 'build, and switch'. Update the comment to match the actual dependencies (or re-add nix-build/nix-switch if that behavior is still intended).

Suggested change
nix-update: nix-connect nix-daemon-update nix-flake-update ## Upgrade Nix flake, build, and switch.
nix-update: nix-connect nix-daemon-update nix-flake-update ## Connect to Nix, update the daemon, and update flake inputs.

Copilot uses AI. Check for mistakes.
Comment on lines +346 to +347

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep nix-daemon-update out of unattended make update runs.

home-manager/services/make-updater/update.sh:1-8 invokes make update, so wiring nix-daemon-update into nix-update now pushes a sudo determinate-nixd upgrade into a background service path. That either fails every run or waits for credentials. Either move the daemon upgrade to upgrade only, or make nix-daemon-update explicitly short-circuit for automated runs.

One safe way to keep background updates non-interactive
-.PHONY: upgrade
-upgrade: sync update
+.PHONY: upgrade
+upgrade: sync nix-daemon-update update

-.PHONY: nix-update
-nix-update: nix-connect nix-daemon-update nix-flake-update ## Upgrade Nix flake, build, and switch.
+.PHONY: nix-update
+nix-update: nix-connect nix-flake-update ## Refresh daemon connectivity and flake inputs.

Also applies to: 377-384

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 324 - 325, The nix-daemon-update step must not run
during unattended make update runs; remove "nix-daemon-update" from the
"nix-update" target and instead wire it only into the interactive "upgrade"
target, or alternatively add a short-circuit at the top of the
"nix-daemon-update" recipe that exits immediately when in automated contexts
(e.g., detect CI or a NONINTERACTIVE/CI env var or lack of a TTY) so automated
callers of "make nix-update" won't invoke the sudo determinate-nixd upgrade;
update both the "nix-update" target definition and the duplicate block around
the other occurrence (the similar target group later in the file) or implement
the env-check guard inside the "nix-daemon-update" rule to cover both
occurrences.


.PHONY: nix-backup
nix-backup: ## Backup configuration files.
Expand Down Expand Up @@ -372,6 +374,15 @@ nix-build: nix-connect ## Build Nix configuration.
fi
@echo "✅ Nix configuration built successfully!"

.PHONY: nix-daemon-update
nix-daemon-update: ## Upgrade Determinate Nix daemon to latest version.
Comment on lines +399 to +400

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions adding nix-daemon-upgrade, but the Makefile introduces nix-daemon-update. Please align naming between the PR description and the actual target name (either rename the target or update the PR description) to avoid confusion for users.

Copilot uses AI. Check for mistakes.
@if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ]; then \
echo "⏭️ Skipping determinate-nixd upgrade in CI"; \
else \
echo "⬆️ Upgrading Determinate Nix daemon..."; \
$(SUDO) determinate-nixd upgrade || true; \
fi

.PHONY: nix-flake-check
nix-flake-check: ## Check Nix flake configuration.
@echo "🔍 Checking Nix flake configuration..."
Expand All @@ -382,8 +393,8 @@ nix-flake-check: ## Check Nix flake configuration.
fi
@echo "✅ Nix flake check completed successfully"

.PHONY: nix-flake-upgrade
nix-flake-upgrade: nix-connect ## Update flake.lock file.
.PHONY: nix-flake-update
nix-flake-update: nix-connect ## Update flake.lock file.
@echo "♻️ Refreshing flake.lock file..."
@if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ] || [ "$$AUTOMATED_UPDATE" = "true" ]; then \
echo "Bypassing flake update in CI/Docker/automated update"; \
Expand Down Expand Up @@ -632,8 +643,14 @@ neovim-dev: ## Set up local Neovim development environment.
@echo "✅ Local Neovim development environment ready"
@echo "🚧 To restore the Nix-managed version, run 'make switch'"

.PHONY: neovim-upgrade
neovim-upgrade: ## Update Neovim plugins.
.PHONY: neovim-sync
neovim-sync: neovim-update ## Sync Neovim plugins.
@echo "🔄 Syncing neovim plugins..."
@nvim --headless +"lua vim.cmd('source ' .. vim.fn.stdpath('config') .. '/init.lua')" +qa
@echo "✅ Neovim plugins synced"

.PHONY: neovim-update
neovim-update: ## Update Neovim plugins.
@echo "📦 Updating neovim plugins..."
@mkdir -p ~/.config/nvim
@if [ -L "$(HOME)/.config/nvim/lua" ] || [ -d "$(HOME)/.config/nvim/lua" ]; then \
Expand All @@ -645,12 +662,6 @@ neovim-upgrade: ## Update Neovim plugins.
@nvim --headless +"lua vim.pack.update()" +qa
@echo "✅ Neovim plugins updated"

.PHONY: neovim-sync
neovim-sync: neovim-upgrade ## Sync Neovim plugins.
@echo "🔄 Syncing neovim plugins..."
@nvim --headless +"lua vim.cmd('source ' .. vim.fn.stdpath('config') .. '/init.lua')" +qa
@echo "✅ Neovim plugins synced"

.PHONY: neovim-test
neovim-test: ## Run Neovim tests using plenary.nvim.
@echo "🧪 Running Neovim tests..."
Expand Down Expand Up @@ -729,13 +740,12 @@ lua-check-hammerspoon-dev: ## Run the Hammerspoon Lua check inside the Nix dev s
launchctl: launchctl-brew-upgrader launchctl-openclaw launchctl-cliproxyapi launchctl-cliproxyapi-backup launchctl-code-syncer launchctl-docker-postgres launchctl-dotfiles-updater launchctl-neverssl-keepalive launchctl-ollama launchctl-tmux-session-logger ## Restart all launchd agents.

.PHONY: launchctl-brew-upgrader
launchctl-brew-upgrader: ## Restart brew-upgrader launchd agent.
@echo "🔄 Restarting brew-upgrader..."
@launchctl unload ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist 2>/dev/null || true
launchctl-brew-upgrader: ## Restart brew-updater launchd agent.
@echo "🔄 Restarting brew-updater..."
@launchctl unload ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist 2>/dev/null || true
Comment on lines +765 to +767

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target name launchctl-brew-upgrader conflicts with the updated agent name/file (brew-updater). Renaming the target to launchctl-brew-updater (and updating any aggregate dependencies listing it) would keep the Makefile interface consistent and reduce confusion.

Copilot uses AI. Check for mistakes.
@sleep 3
@launchctl load ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist
@echo "✅ brew-upgrader restarted"

@launchctl load ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist
@echo "✅ brew-updater restarted"
Comment on lines +765 to +770

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use the existing brew-upgrader plist name here.

home-manager/services/brew-upgrader/default.nix:1-15 still defines launchd.agents.brew-upgrader, so Home Manager will emit org.nix-community.home.brew-upgrader.plist. Pointing launchctl-brew-upgrader at ...brew-updater.plist means the unload/load commands miss the actual agent.

Suggested fix
 launchctl-brew-upgrader: ## Restart brew-updater launchd agent.
-	`@echo` "🔄 Restarting brew-updater..."
-	`@launchctl` unload ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist 2>/dev/null || true
+	`@echo` "🔄 Restarting brew-upgrader..."
+	`@launchctl` unload ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist 2>/dev/null || true
 	`@sleep` 3
-	`@launchctl` load ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist
-	`@echo` "✅ brew-updater restarted"
+	`@launchctl` load ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist
+	`@echo` "✅ brew-upgrader restarted"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
launchctl-brew-upgrader: ## Restart brew-updater launchd agent.
@echo "🔄 Restarting brew-updater..."
@launchctl unload ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist 2>/dev/null || true
@sleep 3
@launchctl load ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist
@echo "✅ brew-upgrader restarted"
@launchctl load ~/Library/LaunchAgents/org.nix-community.home.brew-updater.plist
@echo "✅ brew-updater restarted"
launchctl-brew-upgrader: ## Restart brew-updater launchd agent.
`@echo` "🔄 Restarting brew-upgrader..."
`@launchctl` unload ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist 2>/dev/null || true
`@sleep` 3
`@launchctl` load ~/Library/LaunchAgents/org.nix-community.home.brew-upgrader.plist
`@echo` "✅ brew-upgrader restarted"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 743 - 748, The Makefile target launchctl-brew-upgrader
is pointing at the wrong plist name; update the unload/load commands (and any
user-facing messages if desired) to reference
org.nix-community.home.brew-upgrader.plist instead of
org.nix-community.home.brew-updater.plist so the launchctl unload/load operate
on the Home Manager emitted agent; adjust the two file-path occurrences used in
the `@launchctl` unload and `@launchctl` load invocations within the
launchctl-brew-upgrader target accordingly.


.PHONY: launchctl-cliproxyapi
launchctl-cliproxyapi: ## Restart cliproxyapi launchd agent.
Expand Down Expand Up @@ -1007,8 +1017,8 @@ doppler-upload: ## Upload .env file to Doppler (dotfiles/prd).

##@ Overlays

.PHONY: overlays-upgrade
overlays-upgrade: ## Upgrade all custom overlays to latest versions.
.PHONY: overlays-update
overlays-update: ## Upgrade all custom overlays to latest versions.
@echo "🔄 Upgrading custom overlays..."
@if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ]; then \
echo "⏭️ Skipping overlay upgrade in CI/Docker"; \
Expand Down
Loading