ActivityWatch: Fix Pynput Dependency Blocker

by Admin 45 views
🚨 CRITICAL BLOCKER: ActivityWatch pynput Dependency - Decision Required

Hey everyone,

We've hit a snag that's currently BLOCKING our just switch deployment, and it's all hands on deck to figure out the best way forward. This issue was spotted on 2025-11-15 during wrapper debugging and is marked as a CRITICAL priority because it's stopping all Nix-related work in its tracks. Let's dive in and see how we can get things moving again!

❌ CURRENT ERROR:

error: Package 'python3.13-pynput-1.8.1' is marked as broken, refusing to evaluate.

So, the core problem is that the python3.13-pynput-1.8.1 package is flagged as broken, which is causing our Nix evaluation to fail. To get past this, we need to decide on the best approach. Here are a few options on the table. You MUST choose one approach before the next session!

🎯 DECISION REQUIRED:

Let's break down the options to unblock our Nix deployments. Each option has its pros and cons, so let's weigh them carefully to make an informed decision.

Option A: Homebrew Cask (RECOMMENDED) ⭐

Using Homebrew Cask is a straightforward solution. It involves installing ActivityWatch directly via Homebrew, bypassing the Nix dependency issues altogether. This approach is particularly appealing because ActivityWatch, being a GUI application, aligns well with Homebrew's ecosystem.

Pros:

  • βœ… Immediate Functionality: Works right out of the box using the official macOS app.
  • βœ… Nix-Free: Avoids all the current Nix dependency headaches.
  • βœ… Auto-Updates: Leverages Homebrew for automatic updates, keeping the app current with minimal effort.
  • βœ… Native GUI Integration: Ensures smooth integration with macOS's graphical user interface.
  • βœ… Quick Fix: Can be implemented in approximately 5 minutes.

Cons:

  • ❌ Configuration Loss: Loses the embedded configuration from our current wrapper.
  • ❌ Less "Pure" Nix: Moves away from a fully declarative Nix-managed setup.

Implementation:

To implement this, you'll need to modify your Nix configuration files as follows:

# dotfiles/nix/homebrew.nix
casks = [
  "activitywatch"  # Add this line
];

# dotfiles/nix/wrappers/default.nix
# Comment out activitywatch wrapper

Essentially, we're adding ActivityWatch to the list of casks managed by Homebrew and commenting out the existing wrapper in our Nix configuration. This tells Nix to rely on the Homebrew-installed version of ActivityWatch.


Option B: Override Broken Flag

This option involves forcefully marking the pynput package as not broken within our Nix configuration. While this might seem like a quick fix, it's crucial to understand the potential implications. Packages are often marked as broken for a reason, and overriding this flag could lead to unexpected issues down the line.

Pros:

  • βœ… Nix Wrapper Retention: Keeps our existing Nix wrapper with its embedded configuration intact.
  • βœ… Declarative Approach: Maintains a fully declarative configuration.
  • βœ… Portability: Ensures the setup remains portable across different machines.

Cons:

  • ❌ Underlying Issues: Ignores the reason why the package was marked broken, potentially leading to bugs.
  • ⚠️ Unpredictable Breakage: Could cause unpredictable issues in the future.
  • ⚠️ Maintenance Overhead: Requires ongoing maintenance to ensure the override doesn't cause problems.

Implementation:

To implement this, you'll need to add an overlay to your Nix configuration. Here's how:

# dotfiles/nix/flake.nix or core.nix
nixpkgs.overlays = [
  (final: prev: {
    python3Packages = prev.python3Packages // {
      pynput = prev.python3Packages.pynput.overrideAttrs (old: {
        meta = old.meta // { broken = false; };
      });
    };
  })
];

This overlay essentially tells Nix to ignore the broken flag for the pynput package, allowing it to be installed despite the warning.


Option C: Use Python 3.12

This option suggests that the pynput package might only be broken under Python 3.13. By forcing ActivityWatch to use Python 3.12, we might be able to circumvent the issue. However, this approach introduces additional complexity, as it requires overriding the Python version specifically for ActivityWatch.

Pros:

  • βœ… Potential Solution: Might work if pynput is only broken on Python 3.13.
  • βœ… Nix Wrapper Retention: Keeps the existing Nix wrapper intact.

Cons:

  • ❌ Increased Complexity: Requires overriding the Python version, adding complexity to the configuration.
  • ❌ Verification Needed: Requires verifying which Python version actually works with pynput.
  • ⚠️ Potential Conflicts: Other packages might require Python 3.13, leading to conflicts.

Implementation:

To implement this, you'll need to override the python3 attribute in the ActivityWatch package definition. Here's how:

# Override activitywatch to use Python 3.12
activitywatch = pkgs.activitywatch.override {
  python3 = pkgs.python312;
};

This tells Nix to use Python 3.12 instead of the default Python version when building ActivityWatch.


🎯 MY RECOMMENDATION:

I strongly recommend Option A (Homebrew) for several compelling reasons:

  1. GUI Application: ActivityWatch is fundamentally a GUI application, making it a natural fit for Homebrew's ecosystem. Homebrew is designed to manage and distribute GUI apps on macOS, providing a seamless user experience.
  2. Homebrew Precedent: We already use Homebrew for similar GUI applications like Sublime Text and JetBrains products. This approach aligns with our existing patterns and simplifies management.
  3. Immediate Resolution: Option A provides an immediate solution to the blocking issue, allowing us to resume development without delay. Time is of the essence, and this option offers the fastest path to unblocking our workflow.
  4. Official Distribution: By using the Homebrew cask, we're relying on the official distribution of ActivityWatch. This ensures that we're getting the most up-to-date and stable version of the application, with automatic updates and native integration.
  5. Established Pattern: Following the existing pattern of managing GUI apps via Homebrew and CLI tools via Nix provides consistency and simplifies our overall system administration.

While the embedded configuration in the wrapper is a nice-to-have feature, it's not essential for the core functionality of ActivityWatch. The application's configuration can still be managed separately if needed, mitigating the primary downside of this approach. Therefore, the benefits of Option A outweigh the drawbacks, making it the most sensible choice for resolving this issue quickly and effectively.


⏰ TIME ESTIMATE:

Here's a rough estimate of the time required to implement each option:

  • Option A: 5 minutes
  • Option B: 30-60 minutes (including testing to ensure stability)
  • Option C: 1-2 hours (including investigation and testing to verify compatibility)

🚨 BLOCKER IMPACT:

Until this issue is resolved, the following are blocked:

  • ❌ just switch Execution: We cannot run just switch to update our system.
  • ❌ Nix Deployments: We cannot deploy any Nix changes, halting our infrastructure updates.
  • ❌ Wrapper Testing: We cannot test any fixes to our wrappers, hindering our development efforts.
  • ❌ Nix Work Stoppage: All Nix-related work is currently blocked, impacting productivity across the board.

🎯 ACTION REQUIRED:

To move forward, I need your input. Please reply with your choice:

  • "A" - Use Homebrew cask (my recommendation)
  • "B" - Override broken flag
  • "C" - Try Python 3.12

I'll implement the chosen option immediately during the next session. Let's get this sorted out!


Created: 2025-11-15 08:24:34 CET Blocks: All Nix configuration work Estimated Fix Time: 5 mins (Option A) to 2 hours (Option C)