diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index ae3ba508b..a235ca681 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -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 lua-check: if: always() needs: diff --git a/flake.nix b/flake.nix index 7051f2e8a..82ad56872 100644 --- a/flake.nix +++ b/flake.nix @@ -118,8 +118,19 @@ }; perSystem = - { system, pkgs, ... }: + { system, ... }: + let + overlays = import ./overlays { inherit inputs; }; + nixpkgsConfig = import ./lib/nixpkgs-config.nix { + nixpkgsLib = inputs.nixpkgs.lib; + }; + devPkgs = import inputs.nixpkgs { + inherit system overlays; + config = nixpkgsConfig; + }; + in { + _module.args.pkgs = devPkgs; treefmt = { projectRootFile = "flake.nix"; programs = { @@ -133,13 +144,14 @@ }; }; - devShells.default = pkgs.mkShell { + devShells.default = devPkgs.mkShell { packages = [ - pkgs.nodejs_20 - pkgs.bun + devPkgs.nodejs + devPkgs.bun + devPkgs.neovim ]; shellHook = '' - echo "Dev shell ready: Node.js + bun available." + echo "Dev shell ready: Node.js, bun, and Neovim available." ''; }; }; diff --git a/home-manager/services/default.nix b/home-manager/services/default.nix index 492703b0f..2a6a32fc7 100644 --- a/home-manager/services/default.nix +++ b/home-manager/services/default.nix @@ -3,7 +3,7 @@ let codeSyncer = import ./code-syncer { inherit pkgs; }; dotfilesUpdater = import ./dotfiles-updater { inherit pkgs; }; neversslKeepalive = import ./neverssl-keepalive { inherit pkgs; }; - # ollama = import ./ollama { inherit pkgs; }; # FIXME: ollama 0.12.11 has build issues with UI assets, uncomment when fixed + ollama = import ./ollama { inherit pkgs; }; brewUpgrader = import ./brew-upgrader { inherit pkgs; }; in [ @@ -11,5 +11,5 @@ in codeSyncer dotfilesUpdater neversslKeepalive - # ollama + ollama ] diff --git a/home-manager/services/ollama/default.nix b/home-manager/services/ollama/default.nix index 09fff6489..ac13e92ef 100644 --- a/home-manager/services/ollama/default.nix +++ b/home-manager/services/ollama/default.nix @@ -1,13 +1,30 @@ { pkgs }: let - inherit (pkgs) lib; + inherit (pkgs) lib writeShellApplication; + + # launchd wrapper so we can reuse the Homebrew-installed ollama binary + ollamaHomebrew = writeShellApplication { + name = "ollama-homebrew"; + text = '' + set -euo pipefail + + if [ -x /opt/homebrew/bin/ollama ]; then + 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 + ''; + }; in lib.mkIf pkgs.stdenv.isDarwin { launchd.agents.ollama = { enable = true; config = { ProgramArguments = [ - "${pkgs.ollama}/bin/ollama" + (lib.getExe ollamaHomebrew) "serve" ]; KeepAlive = true; diff --git a/nix-darwin/config/homebrew.nix b/nix-darwin/config/homebrew.nix index ab56b3c06..7a6238585 100644 --- a/nix-darwin/config/homebrew.nix +++ b/nix-darwin/config/homebrew.nix @@ -31,6 +31,7 @@ "kurtosis-cli" "mas" "opencode" + "ollama" "pandoc" "pinentry-mac" "pnpm" @@ -71,7 +72,7 @@ "linear-linear" "lm-studio" "notion" - # "ollama-app" # FIXME: conflicts_with formula is disabled, uncomment when Homebrew fixes conflict + "ollama-app" "raycast" "rescuetime" "screen-studio"