Skip to content

feat(nix): enhance unfree package configuration in home-manager and NixOS - #321

Merged
shunkakinoki merged 3 commits into
mainfrom
chore/update-default-manager
Nov 8, 2025
Merged

feat(nix): enhance unfree package configuration in home-manager and NixOS#321
shunkakinoki merged 3 commits into
mainfrom
chore/update-default-manager

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Nov 8, 2025

Copy link
Copy Markdown
Owner
  • Updated the Nix configuration to allow unfree packages by setting nixpkgs.config.allowUnfree = true;.
  • Expanded the allowUnfreePredicate to include "crush" alongside existing packages "claude-code" and "qwen-code" for improved package management.

Note

Enable unfree packages across Home Manager and NixOS, add "crush" to allowed unfree list, and import pkgs with unfree enabled instead of legacyPackages.

  • Home Manager (home-manager/default.nix):
    • Configure nixpkgs.config with allowUnfree = true and extend allowUnfreePredicate to include "crush" alongside "claude-code" and "qwen-code".
  • NixOS Host (hosts/nixos/default.nix):
    • Import pkgs via import nixpkgs { system; config.allowUnfree = true; } (replacing legacyPackages).
    • Remove inline nixpkgs.config.allowUnfree in modules and pass the new pkgs through to Home Manager.

Written by Cursor Bugbot for commit 4779941. Configure here.


Summary by cubic

Enables unfree packages across Home Manager and NixOS and adds “crush” to the allowed list alongside “claude-code” and “qwen-code.” Also updates the NixOS build command and adds a disk cleanup step to the e2e workflow for more reliable builds.

  • Refactors

    • Import nixpkgs with config.allowUnfree in hosts/nixos/default.nix and remove duplicate per-module setting.
    • Define nixpkgs.config in Home Manager with allowUnfree and updated allowUnfreePredicate.
    • Pass the unified pkgs to home-manager.users for consistency.
    • Update Makefile to build the NixOS runner toplevel directly.
  • New Features

    • Add disk space cleanup step for Ubuntu runners in the e2e workflow.

Written for commit 81f9b7b. Summary will update automatically on new commits.

…ixOS

- Updated the Nix configuration to allow unfree packages by setting `nixpkgs.config.allowUnfree = true;`.
- Expanded the `allowUnfreePredicate` to include "crush" alongside existing packages "claude-code" and "qwen-code" for improved package management.
Copilot AI review requested due to automatic review settings November 8, 2025 22:26
@shunkakinoki shunkakinoki self-assigned this Nov 8, 2025
@coderabbitai

coderabbitai Bot commented Nov 8, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Enhanced package management configuration structure to support expanded software options
    • Optimized CI workflows by implementing automatic disk space cleanup for Linux runners
    • Refined system build processes to improve consistency and reliability across environments
    • Streamlined infrastructure management for better maintainability

Walkthrough

Reorganizes how unfree packages are allowed: moves from using legacyPackages to importing nixpkgs with config.allowUnfree = true, consolidates nixpkgs.config in home-manager/default.nix and adds "crush" to the allowUnfreePredicate. Also adds a Linux-only "Free Disk Space" step to E2E workflow and changes CI make target to build the NixOS toplevel derivation directly.

Changes

Cohort / File(s) Change Summary
Nixpkgs allowUnfree restructuring
home-manager/default.nix
Replaces direct nixpkgs.config.allowUnfreePredicate assignment with a nested nixpkgs.config set: allowUnfree = true and an updated allowUnfreePredicate that includes "crush"
Pkgs import & home-manager integration
hosts/nixos/default.nix
Changes pkgs from nixpkgs.legacyPackages.${system} to import nixpkgs { inherit system; config.allowUnfree = true; }; removes nixpkgs.config.allowUnfree = true from the nixosSystem block; passes the new pkgs into home-manager
CI / Workflow changes
.github/workflows/e2e.yml, Makefile
Adds a Linux-only "Free Disk Space (Ubuntu)" step using free-disk-space action in E2E workflow; updates make nix-build CI path to build .#nixosConfigurations.runner.config.system.build.toplevel with --show-trace instead of nix run nixpkgs#nixos-rebuild

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI (Make / GitHub Actions)
    participant Nixpkgs as nixpkgs repo
    participant Import as pkgs (imported)
    participant Home as home-manager module
    rect rgba(150,200,255,0.08) 
    note right of Nixpkgs: Old flow used\nlegacyPackages.${system}
    Nixpkgs->>CI: legacyPackages.${system}
    CI->>Home: pass pkgs (legacyPackages)
    end
    rect rgba(200,255,180,0.08)
    note right of Import: New flow imports nixpkgs\nwith config.allowUnfree=true
    Nixpkgs->>Import: import { system, config.allowUnfree = true }
    Import->>CI: pkgs
    CI->>Home: pass pkgs (imported with allowUnfree)
    Home->>Import: evaluate allowUnfreePredicate (includes "crush")
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect home-manager/default.nix predicate implementation to ensure no scoping/closure regressions.
  • Verify hosts/nixos/default.nix pkgs import produces identical package set for all consumers (home-manager, system).
  • Confirm CI make nix-build and workflow free-disk-space step work on targeted runners and that --show-trace usage is acceptable.

Possibly related PRs

  • Chore/atuin-config #317 — also modifies how nixpkgs.allowUnfree is set in NixOS hosts; strongly related to the allowUnfree changes here.

Poem

🐰 I hopped through flakes and tried my luck,

I found a package named sweet "crush"—what pluck!
Configs rearranged, imports made true,
CI cleared space, and builds run anew,
A rabbit's cheer for tidy Nix glue. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: enhancing unfree package configuration in home-manager and NixOS, which matches the core objective of enabling unfree packages and updating configuration.
Description check ✅ Passed The description is directly related to the changeset, detailing specific configuration updates, package additions, and refactoring efforts that align with the file changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-default-manager

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the Nix configuration for both home-manager and NixOS to enhance the management and allowance of unfree packages. It centralizes the allowUnfree = true setting and expands the list of specifically permitted unfree packages, ensuring a more consistent and flexible environment for users needing access to proprietary software. The changes aim to simplify the setup for unfree packages while maintaining clarity in the configuration.

Highlights

  • Global Unfree Package Allowance: The configuration now explicitly sets nixpkgs.config.allowUnfree = true; in both home-manager and NixOS, streamlining the use of unfree packages across the system.
  • Expanded Unfree Predicate: The allowUnfreePredicate in the home-manager configuration has been updated to include "crush", alongside "claude-code" and "qwen-code", allowing specific unfree packages to be used.
  • Refactored pkgs Import in NixOS: The pkgs variable in the NixOS configuration is now imported with config.allowUnfree = true directly, and this configured pkgs set is consistently passed to the home-manager module, ensuring unified unfree package handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Nov 8, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Enabled unfree packages across Home Manager and NixOS, added "crush" to the allowed unfree list, and refactored pkgs import for consistency.

What changed?

  • home-manager/default.nix: Updated nixpkgs.config to explicitly set allowUnfree = true; and restructured its configuration. Added "crush" to the allowUnfreePredicate list.
  • hosts/nixos/default.nix: Refactored pkgs to directly import nixpkgs with config.allowUnfree = true, removing redundant settings. The home-manager module now consistently uses the top-level pkgs variable.

Description generated by Mesa. Update settings

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread home-manager/default.nix
"claude-code"
"qwen-code"
"crush"
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Conflicting Unfree Settings Allow All Packages

Setting allowUnfree = true allows all unfree packages, which makes the allowUnfreePredicate restriction ineffective. The predicate is intended to limit unfree packages to only "claude-code", "qwen-code", and "crush", but allowUnfree = true overrides this restriction and permits any unfree package. Either remove allowUnfree = true to enforce the predicate's restrictions, or remove allowUnfreePredicate if all unfree packages should be allowed.

Fix in Cursor Fix in Web

Copilot AI left a comment

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.

Pull Request Overview

This PR refactors the handling of unfree packages configuration in NixOS and home-manager setups by centralizing the allowUnfree setting and updating package initialization.

  • Refactored pkgs initialization to use import nixpkgs with inline config instead of legacyPackages
  • Consolidated unfree package configuration by moving settings to appropriate scopes
  • Added "crush" to the list of allowed unfree packages in home-manager

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
hosts/nixos/default.nix Moved allowUnfree configuration to pkgs import at module level, removed redundant nixpkgs.config setting, and simplified pkgs reference in home-manager
home-manager/default.nix Restructured nixpkgs.config with both allowUnfree and allowUnfreePredicate settings, and added "crush" to the predicate list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread home-manager/default.nix
Comment on lines +34 to +43
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
"qwen-code"
"crush"
];
};

Copilot AI Nov 8, 2025

Copy link

Choose a reason for hiding this comment

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

Setting both allowUnfree = true and allowUnfreePredicate creates a logical inconsistency. When allowUnfree = true is set, it allows ALL unfree packages, making the allowUnfreePredicate function ineffective.

If you want to restrict unfree packages to only the listed ones ("claude-code", "qwen-code", "crush"), you should remove allowUnfree = true and keep only the predicate. If you want to allow all unfree packages, you should remove the predicate and keep only allowUnfree = true.

Copilot uses AI. Check for mistakes.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request enhances the configuration for unfree packages in both home-manager and NixOS. The changes centralize the allowUnfree setting and move away from using legacyPackages. My review focuses on modernizing the use of allowUnfree configuration to align with current Nixpkgs best practices. I've suggested replacing the deprecated allowUnfreePredicate with a predicate function on allowUnfree for better clarity and correctness.

Comment thread home-manager/default.nix
Comment on lines +35 to +42
allowUnfree = true;
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
"qwen-code"
"crush"
];

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.

high

The allowUnfreePredicate option is deprecated. It's recommended to use allowUnfree with a predicate function instead. Also, setting allowUnfree = true allows all unfree packages, which makes the predicate on the following lines redundant and may not be your intention.

To allow only the specified list of unfree packages, you can define allowUnfree as a predicate function directly. This is the modern and recommended approach in Nixpkgs.

    allowUnfree = pkg:
      builtins.elem (lib.getName pkg) [
        "claude-code"
        "qwen-code"
        "crush"
      ];


- Modified the NixOS build command in the Makefile to use the correct path for the runner configuration, enhancing the build process and ensuring compatibility with the current setup.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a878621 and 4779941.

📒 Files selected for processing (2)
  • home-manager/default.nix (1 hunks)
  • hosts/nixos/default.nix (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Format all Nix files with nixfmt

**/*.nix: Nix: Use 2 spaces for indentation
Nix: Keep line length under 100 characters
Nix: Sort attribute sets alphabetically
Nix: Use consistent spacing around operators
Nix: Format lists and sets consistently

Follow the Nix expression language style guide

Files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
hosts/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Keep host-specific configurations under hosts/

Files:

  • hosts/nixos/default.nix
home-manager/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Keep home-manager configurations under home-manager/

Files:

  • home-manager/default.nix
home-manager/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Use proper indentation and formatting in Nix files

Files:

  • home-manager/default.nix
🧠 Learnings (17)
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Use home.packages for package installations in program configurations

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:25:07.125Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-28T16:25:07.125Z
Learning: Applies to **/default.nix : Use default.nix files for module exports

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should prefer Home Manager’s built-in modules when available

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/modules/*/default.nix : Follow Home Manager’s module structure (options + config with mkIf, mkEnableOption, etc.)

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should include all necessary dependencies

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should follow the provided template (programs.<name>.enable, package, and settings attrset)

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/modules/**/default.nix : Modules must include proper option declarations (e.g., options.modules.<name> with mkEnableOption/mkOption)

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:25:07.125Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-28T16:25:07.125Z
Learning: Prefer Nix packages over external package managers

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/modules/**/default.nix : Modules must follow the Home Manager module structure (define options and gate config with mkIf cfg.enable)

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Program configurations should include all necessary dependencies

Applied to files:

  • hosts/nixos/default.nix
  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Use programs.<name> options provided by Home Manager when available

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations must be located in home-manager/programs/<name>/ with configuration in default.nix

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/**/*.nix : Use proper indentation and formatting in Nix files

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/modules/*/default.nix : Custom modules must be placed under home-manager/modules/<name>/ and include a default.nix entry point

Applied to files:

  • hosts/nixos/default.nix
📚 Learning: 2025-09-28T16:26:18.516Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-28T16:26:18.516Z
Learning: Applies to flake.nix : Maintain the main Nix configuration in flake.nix

Applied to files:

  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/modules/**/default.nix : Each module under home-manager/modules must provide a clear default.nix entry point

Applied to files:

  • home-manager/default.nix
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/modules/**/default.nix : Document all custom modules and their options

Applied to files:

  • home-manager/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Mesa
  • GitHub Check: nix-linux
  • GitHub Check: nix-nixos
  • GitHub Check: nix-darwin
  • GitHub Check: docker-build-push (linux/amd64, -amd64, amd64)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
🔇 Additional comments (2)
hosts/nixos/default.nix (2)

10-13: LGTM! Clean approach to enabling unfree packages.

The direct import of nixpkgs with config.allowUnfree = true is clearer than using legacyPackages and ensures consistent unfree package support across the configuration.


123-123: LGTM! Correctly uses the unified pkgs binding.

This ensures home-manager uses the same package set with unfree support enabled, maintaining consistency with the NixOS configuration.

Comment thread home-manager/default.nix
Comment on lines +34 to +43
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
"qwen-code"
"crush"
];
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove redundant configuration: allowUnfree = true makes the predicate unnecessary.

Setting allowUnfree = true allows ALL unfree packages, which makes the allowUnfreePredicate redundant and creates logical confusion. The predicate is typically used to selectively allow specific unfree packages when allowUnfree is not set or is false.

Choose one approach:

Option 1 (Recommended): Allow all unfree packages

 nixpkgs.config = {
   allowUnfree = true;
-  allowUnfreePredicate =
-    pkg:
-    builtins.elem (lib.getName pkg) [
-      "claude-code"
-      "qwen-code"
-      "crush"
-    ];
 };

Option 2: Selectively allow only specific unfree packages

 nixpkgs.config = {
-  allowUnfree = true;
   allowUnfreePredicate =
     pkg:
     builtins.elem (lib.getName pkg) [
       "claude-code"
       "qwen-code"
       "crush"
     ];
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
"qwen-code"
"crush"
];
};
nixpkgs.config = {
allowUnfree = true;
};
🤖 Prompt for AI Agents
In home-manager/default.nix around lines 34 to 43, remove the redundancy between
allowUnfree and allowUnfreePredicate: either (A) keep allowUnfree = true and
delete the entire allowUnfreePredicate block so all unfree packages are allowed,
or (B) set allowUnfree = false (or remove it) and keep the allowUnfreePredicate
array to selectively allow "claude-code", "qwen-code", and "crush"; apply one of
these two options and ensure the resulting nixpkgs.config is syntactically
valid.

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Performed full review of a878621...4779941

Analysis

  1. Conflicting Unfree Package Configurations: The PR sets global allowUnfree = true at the NixOS level while implementing a restrictive allowUnfreePredicate in home-manager. This creates architectural inconsistency where the predicate is effectively bypassed since packages are already instantiated with unrestricted permissions.

  2. Security Bypass: The restrictive predicate approach (a security best practice) is rendered ineffective, creating a false sense of security while actually allowing all unfree packages through the global NixOS-level configuration.

  3. Configuration Duplication: Unfree package settings appear redundantly across host pkgs, home-manager config, and nix-darwin configurations with no clear hierarchy, violating separation of concerns.

  4. Platform Inconsistency: NixOS and Darwin configurations handle unfree packages differently, creating maintenance challenges and potential confusion for developers.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

2 files reviewed | 2 comments | Edit Agent SettingsRead Docs

Comment thread hosts/nixos/default.nix
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

This global allowUnfree = true configuration conflicts with the restrictive allowUnfreePredicate defined in home-manager/default.nix (lines 36-42). Since this pkgs instance is passed to home-manager (line 123), the predicate becomes ineffective. Consider moving the predicate here instead:

pkgs = import nixpkgs {
  inherit system;
  config.allowUnfreePredicate = pkg:
    builtins.elem (lib.getName pkg) [
      "claude-code" "qwen-code" "crush"
    ];
};

This ensures consistent unfree package restrictions across both NixOS and home-manager.

Agent: 🏛 Architecture • Fix in Cursor

Comment thread home-manager/default.nix
"qwen-code"
];
nixpkgs.config = {
allowUnfree = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

Setting allowUnfree = true here is redundant and contradictory with the allowUnfreePredicate below. When using a predicate to restrict unfree packages to a specific allowlist, you don't need (and shouldn't use) allowUnfree = true. The predicate already enables unfree packages for those matching the condition. More critically, since hosts/nixos/default.nix now passes a pkgs instance configured with global allowUnfree = true (line 12), this home-manager predicate won't effectively restrict packages from that shared pkgs instance.

Agent: 🏛 Architecture • Fix in Cursor

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="home-manager/default.nix">

<violation number="1" location="home-manager/default.nix:35">
Configuring allowUnfree = true alongside allowUnfreePredicate is contradictory: allowUnfree = true permits all unfree packages and makes the predicate ineffective. Choose one path—either allow all unfree packages or remove allowUnfree to enforce the predicate.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Comment thread home-manager/default.nix
"qwen-code"
];
nixpkgs.config = {
allowUnfree = true;

@cubic-dev-ai cubic-dev-ai Bot Nov 8, 2025

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.

Configuring allowUnfree = true alongside allowUnfreePredicate is contradictory: allowUnfree = true permits all unfree packages and makes the predicate ineffective. Choose one path—either allow all unfree packages or remove allowUnfree to enforce the predicate.

Prompt for AI agents
Address the following comment on home-manager/default.nix at line 35:

<comment>Configuring allowUnfree = true alongside allowUnfreePredicate is contradictory: allowUnfree = true permits all unfree packages and makes the predicate ineffective. Choose one path—either allow all unfree packages or remove allowUnfree to enforce the predicate.</comment>

<file context>
@@ -31,12 +31,16 @@ in
-      &quot;qwen-code&quot;
-    ];
+  nixpkgs.config = {
+    allowUnfree = true;
+    allowUnfreePredicate =
+      pkg:
</file context>
Fix with Cubic

- Introduced a new step in the e2e workflow to free up disk space on Linux runners, enhancing the environment's performance and reliability during tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
Makefile (1)

206-235: Clarify CI vs non-CI build strategy divergence.

The CI path (line 214) now builds the toplevel derivation directly, while the non-CI path (line 228) still uses nixos-rebuild. This divergence is likely intentional (CI optimizes for pure build artifacts, non-CI integrates with system state), but consider adding an inline comment to document this distinction for future maintainers.

Example comment to add above line 214:

 		elif [ "$(NIX_CONFIG_TYPE)" = "nixosConfigurations" ]; then \
+			# CI: Build toplevel derivation directly for speed and reproducibility \
 			$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#nixosConfigurations.runner.config.system.build.toplevel $(NIX_FLAGS) --impure --no-update-lock-file --show-trace; \
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4779941 and 81f9b7b.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yml (1 hunks)
  • Makefile (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.github/workflows/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Store all GitHub Actions workflow files under .github/workflows/

Files:

  • .github/workflows/e2e.yml
.github/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Keep GitHub repository configuration files under .github/

Files:

  • .github/workflows/e2e.yml
.github/workflows/*.yml

📄 CodeRabbit inference engine (.cursor/rules/github-workflows.mdc)

.github/workflows/*.yml: Pin actions to specific versions (avoid @main/@master)
Set appropriate timeout limits for jobs/steps
Use concise job and step names
Add helpful annotations and comments in workflows
Prefer using GITHUB_TOKEN for authentication in workflows
Store sensitive data in repository secrets and reference them from workflows
Limit permissions to the minimum required using the permissions key
Define appropriate failure conditions for steps/jobs
Provide clear error messages on failures
Configure notifications for workflow failures
Archive build artifacts for debugging on failures

Files:

  • .github/workflows/e2e.yml
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Use home.packages for package installations in program configurations
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/modules/*/default.nix : Follow Home Manager’s module structure (options + config with mkIf, mkEnableOption, etc.)
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/modules/**/default.nix : Modules must follow the Home Manager module structure (define options and gate config with mkIf cfg.enable)
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/default.nix : Program configurations in home-manager/programs should be organized by program name (one directory per program with a default.nix)
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Program configurations should include all necessary dependencies
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-28T16:25:07.125Z
Learning: Prefer Nix packages over external package managers
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should prefer Home Manager’s built-in modules when available
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/**/*.nix : Use proper indentation and formatting in Nix files
📚 Learning: 2025-09-28T16:26:18.516Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-28T16:26:18.516Z
Learning: Use GitHub Actions for CI/CD checks

Applied to files:

  • .github/workflows/e2e.yml
📚 Learning: 2025-09-28T16:26:53.964Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-09-28T16:26:53.964Z
Learning: Applies to .github/workflows/ci.yml : Use a matrix strategy for OS and system targets with appropriate excludes

Applied to files:

  • .github/workflows/e2e.yml
📚 Learning: 2025-09-28T16:26:53.964Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-09-28T16:26:53.964Z
Learning: Applies to .github/workflows/ci.yml : CI must validate system configurations

Applied to files:

  • .github/workflows/e2e.yml
📚 Learning: 2025-09-28T16:26:53.964Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-09-28T16:26:53.964Z
Learning: Applies to .github/workflows/ci.yml : Use conditional job execution for PRs or main branch using an if expression

Applied to files:

  • .github/workflows/e2e.yml
📚 Learning: 2025-09-28T16:26:18.516Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-28T16:26:18.516Z
Learning: Applies to flake.nix : Maintain the main Nix configuration in flake.nix

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:26:53.964Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-09-28T16:26:53.964Z
Learning: Applies to .github/workflows/ci.yml : CI must validate nix-darwin builds

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Program configurations should include all necessary dependencies

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:26:18.516Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-28T16:26:18.516Z
Learning: Applies to nix-darwin/** : Keep Darwin-specific configurations under nix-darwin/

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/modules/*/default.nix : Follow Home Manager’s module structure (options + config with mkIf, mkEnableOption, etc.)

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Use home.packages for package installations in program configurations

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:25:07.125Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-28T16:25:07.125Z
Learning: Applies to nix-darwin/** : Use Homebrew only for macOS-specific applications within nix-darwin configs

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:25:07.125Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-28T16:25:07.125Z
Learning: Applies to flake.nix : Use Nix Flakes with flake.nix as the entry point

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:27:59.822Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-09-28T16:27:59.822Z
Learning: Applies to home-manager/programs/**/*.nix : Use programs.<name> options provided by Home Manager when available

Applied to files:

  • Makefile
📚 Learning: 2025-09-28T16:27:24.275Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-09-28T16:27:24.275Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should include all necessary dependencies

Applied to files:

  • Makefile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: docker-build-push (linux/amd64, -amd64, amd64)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: nix-darwin
  • GitHub Check: nix-nixos
  • GitHub Check: nix-linux
🔇 Additional comments (3)
.github/workflows/e2e.yml (2)

29-39: Appropriate step placement and configuration once version is pinned.

The step is correctly conditioned for Linux runners and well-positioned after Checkout but before heavy setup operations, which helps maximize available disk space for subsequent build steps. The configuration options are reasonable for CI disk cleanup.

Once the action version is pinned (see previous comment), this step looks good.


29-39: No changes required — the action correctly uses @main.

The jlumbroso/free-disk-space action does not publish versioned releases or tags; it is only available on the default branch (main). Using @main is the only available option for this action.

The coding guideline to pin actions to specific versions applies to actions that publish version tags. This action does not, making the use of @main correct.

Makefile (1)

213-214: Verify the toplevel derivation path for CI nixosConfigurations build.

Line 214 changes the CI build strategy for nixosConfigurations from using nixos-rebuild to directly building the toplevel derivation at .#nixosConfigurations.runner.config.system.build.toplevel. The hardcoded .runner target is appropriate for CI context, and the direct build approach is more efficient. However, verify that:

  1. This derivation path resolves correctly in your flake.nix with the nixosConfigurations.runner entry
  2. The upstream changes to hosts/nixos/default.nix (importing pkgs with allowUnfree) correctly propagate through to this toplevel build

You can verify this works by ensuring the NixOS flake configuration properly exposes the system.build.toplevel output at the expected path. If you'd like, I can help generate a verification script to test the build path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants