-
Notifications
You must be signed in to change notification settings - Fork 0
feat(makefile): add platform-specific service restart commands #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| .PHONY: test | ||
| test: neovim-test shell-test ## Run all tests (neovim + shell). | ||
|
|
@@ -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. | ||
|
||
|
|
||
| .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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new
To fix this and align with the |
||
|
|
||
| ##@ Git Submodule | ||
|
|
||
| .PHONY: git-submodule-sync | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good practice to handle the case where
$(OS)is neither "Darwin" nor "Linux". Adding anelseclause to the conditional would provide clearer feedback to users on unsupported operating systems, preventing silent failures or confusion.