Repository navigation
Restore Ollama service and update Homebrew configuration #368
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 3 commits
e0468cb
c3f0ab6
a61400d
0f566a9
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,10 +24,8 @@ jobs: | |||||
| uses: cachix/install-nix-action@v31 | ||||||
| with: | ||||||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| - name: Install Neovim | ||||||
| run: nix profile install nixpkgs#neovim | ||||||
| - name: Validate Neovim Configuration | ||||||
| run: make lua-check-neovim | ||||||
| - name: Validate Neovim Configuration (Dev Shell) | ||||||
| run: nix develop .# --command make lua-check-neovim | ||||||
| lua-hammerspoon: | ||||||
| runs-on: macos-latest | ||||||
| timeout-minutes: 300 | ||||||
|
|
@@ -38,8 +36,8 @@ jobs: | |||||
| uses: cachix/install-nix-action@v31 | ||||||
| with: | ||||||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| - name: Validate Hammerspoon Configuration | ||||||
| run: make lua-check-hammerspoon | ||||||
| - name: Validate Hammerspoon Configuration (Dev Shell) | ||||||
| run: nix develop .# --command make lua-check-hammerspoon | ||||||
|
||||||
| run: nix develop .# --command make lua-check-hammerspoon | |
| run: nix develop .#default --command make lua-check-hammerspoon |
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.
Keep macOS CI on supported nix systems
The macOS job now enters the flake dev shell via nix develop .# --command make lua-check-hammerspoon, but the flake only declares systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" ]. On the default GitHub macos-latest runner (which is still x86_64-darwin), nix develop aborts with “system not supported” before the Lua check runs, breaking the job. Consider switching the runner to an arm64 image or adding x86_64-darwin to the flake systems so the dev shell can be instantiated on macOS CI.
Useful? React with 👍 / 👎.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,30 @@ | ||
| { pkgs }: | ||
| let | ||
| inherit (pkgs) lib; | ||
| inherit (pkgs) lib writeShellApplication; | ||
|
|
||
| # launchd wrapper so we can reuse the Homebrew-installed ollama binary | ||
|
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. This wrapper pattern creates a runtime dependency on Homebrew state that isn't captured in flake.lock, breaking Nix's reproducibility guarantees. Consider adding: (1) a comment with a TODO and tracking issue for reverting to Nix-packaged ollama when upstream build issues are fixed, (2) version validation to ensure compatibility between the Nix service configuration and Homebrew binary, (3) documentation explaining why this workaround exists. |
||
| ollamaHomebrew = writeShellApplication { | ||
| name = "ollama-homebrew"; | ||
| text = '' | ||
| set -euo pipefail | ||
|
|
||
| if [ -x /opt/homebrew/bin/ollama ]; then | ||
|
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 hard-coded Homebrew paths assume standard installation locations. Consider using |
||
| exec /opt/homebrew/bin/ollama "$@" | ||
| elif [ -x /usr/local/bin/ollama ]; then | ||
| exec /usr/local/bin/ollama "$@" | ||
| else | ||
| echo "ollama binary not found; install it with \"brew install ollama\"" >&2 | ||
| exit 1 | ||
| fi | ||
|
Comment on lines
+11
to
+18
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. For better readability and future extensibility, you could simplify this shell script. Using a |
||
| ''; | ||
| }; | ||
| in | ||
| lib.mkIf pkgs.stdenv.isDarwin { | ||
| launchd.agents.ollama = { | ||
| enable = true; | ||
| config = { | ||
| ProgramArguments = [ | ||
| "${pkgs.ollama}/bin/ollama" | ||
| (lib.getExe ollamaHomebrew) | ||
| "serve" | ||
| ]; | ||
| KeepAlive = true; | ||
|
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. With |
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |||
| "kurtosis-cli" | ||||
| "mas" | ||||
| "opencode" | ||||
| "ollama" | ||||
|
||||
| "ollama" |
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.
This formula is now a required runtime dependency for the home-manager Ollama service, not just an optional installation. Consider documenting this dependency relationship with a comment, and note that since Homebrew formulae aren't version-pinned here, brew upgrade could introduce breaking changes without corresponding updates to the Nix service configuration. You may want to add a comment about version compatibility expectations.
Agent: 🏛 Architecture
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.
[nitpick] The
.#syntax should be.#defaultfor clarity. While.#implicitly refers to the default development shell, being explicit improves readability and avoids potential confusion.