Skip to content
Merged
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
33 changes: 32 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ setup: nix-setup ## Basic Nix setup (alias for nix-setup).
setup-dev: nix-setup git-submodule-sync shell-install ## Set up local development environment (Nix + submodules + shell).

.PHONY: switch
switch: nix-switch launchctl ## Apply Nix configuration and restart launchd agents.
switch: nix-switch services ## Apply Nix configuration and restart services.

.PHONY: services
services: ## Restart platform-specific services (launchd on macOS, systemd on Linux).
@if [ "$(OS)" = "Darwin" ]; then \
$(MAKE) launchctl; \
elif [ "$(OS)" = "Linux" ]; then \
$(MAKE) systemctl; \
fi
Comment on lines +149 to +153

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

It's good practice to handle the case where $(OS) is neither "Darwin" nor "Linux". Adding an else clause to the conditional would provide clearer feedback to users on unsupported operating systems, preventing silent failures or confusion.

	@if [ "$(OS)" = "Darwin" ]; then \
		$(MAKE) launchctl; \
	elif [ "$(OS)" = "Linux" ]; then \
		$(MAKE) systemctl; \
	else \
		echo "No platform-specific services to restart for OS $(OS)"; \
	fi


.PHONY: test
test: neovim-test shell-test ## Run all tests (neovim + shell).
Expand Down Expand Up @@ -630,6 +638,29 @@ launchctl-ollama: ## Restart ollama launchd agent.
@launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.ollama || true
@echo "✅ ollama restarted"

##@ Systemd Services (Linux)

.PHONY: systemctl
systemctl: systemctl-code-syncer systemctl-dotfiles-updater systemctl-ollama ## Restart all systemd user services.

Copilot AI Dec 13, 2025

Copy link

Choose a reason for hiding this comment

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

The systemctl target only restarts 3 services (code-syncer, dotfiles-updater, ollama) while the launchctl target restarts 6 services (brew-upgrader, cliproxyapi, code-syncer, dotfiles-updater, neverssl-keepalive, ollama). This creates platform inconsistency where macOS users get more services restarted than Linux users when running 'make switch'. Either add the missing systemctl targets for brew-upgrader, cliproxyapi, and neverssl-keepalive, or document why these services are macOS-only.

Copilot uses AI. Check for mistakes.

.PHONY: systemctl-code-syncer
systemctl-code-syncer: ## Restart code-syncer systemd user service.
@echo "🔄 Restarting code-syncer..."
@systemctl --user restart code-syncer.service || true
@echo "✅ code-syncer restarted"

.PHONY: systemctl-dotfiles-updater
systemctl-dotfiles-updater: ## Restart dotfiles-updater systemd user service.
@echo "🔄 Restarting dotfiles-updater..."
@systemctl --user restart dotfiles-updater.service || true
@echo "✅ dotfiles-updater restarted"

.PHONY: systemctl-ollama
systemctl-ollama: ## Restart ollama systemd user service.
@echo "🔄 Restarting ollama..."
@systemctl --user restart ollama.service || true
@echo "✅ ollama restarted"
Comment on lines +644 to +662

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 new systemctl targets have some inconsistencies with the available services defined in the Nix configurations.

  1. Incorrect Service: The code-syncer service is macOS-only, so the systemctl-code-syncer target will fail on Linux and should be removed.
  2. Missing Services: The cliproxyapi and neverssl-keepalive services have Linux implementations but are missing corresponding systemctl-* targets and are not included in the main systemctl aggregate target.

To fix this and align with the launchctl targets, the systemctl targets should be updated. I've also sorted them alphabetically for better readability.

systemctl: systemctl-cliproxyapi systemctl-dotfiles-updater systemctl-neverssl-keepalive systemctl-ollama ## Restart all systemd user services.

.PHONY: systemctl-cliproxyapi
systemctl-cliproxyapi: ## Restart cliproxyapi systemd user service.
	@echo "🔄 Restarting cliproxyapi..."
	@systemctl --user restart cliproxyapi.service || true
	@echo "✅ cliproxyapi restarted"

.PHONY: systemctl-dotfiles-updater
systemctl-dotfiles-updater: ## Restart dotfiles-updater systemd user service.
	@echo "🔄 Restarting dotfiles-updater..."
	@systemctl --user restart dotfiles-updater.service || true
	@echo "✅ dotfiles-updater restarted"

.PHONY: systemctl-neverssl-keepalive
systemctl-neverssl-keepalive: ## Restart neverssl-keepalive systemd user service.
	@echo "🔄 Restarting neverssl-keepalive..."
	@systemctl --user restart neverssl-keepalive.service || true
	@echo "✅ neverssl-keepalive restarted"

.PHONY: systemctl-ollama
systemctl-ollama: ## Restart ollama systemd user service.
	@echo "🔄 Restarting ollama..."
	@systemctl --user restart ollama.service || true
	@echo "✅ ollama restarted"


##@ Git Submodule

.PHONY: git-submodule-sync
Expand Down
Loading