Skip to content

Dev#5

Merged
ClementBobin merged 48 commits intomainfrom
DEV
Jun 25, 2025
Merged

Dev#5
ClementBobin merged 48 commits intomainfrom
DEV

Conversation

@ClementBobin
Copy link
Owner

@ClementBobin ClementBobin commented Jun 15, 2025

This pull request introduces significant refactoring and enhancements to the configuration modules, focusing on improving maintainability, consistency, and modularity. The changes include renaming configuration paths, introducing reusable mappings for packages, and simplifying package selection logic. Below is a summary of the most important changes grouped by theme.

Refactoring of Configuration Paths

  • Updated all configuration paths from config.modules.common to config.modules.hm across multiple modules to align with the new naming convention. This affects modules for browsers, communication tools, development environments, and documentation. [1] [2] [3] [4] [5]

Modularization of Package Mappings

  • Introduced mappings for browsers, communication tools, CLI tools, and document editors to their respective packages, replacing repetitive logic with reusable data structures. This improves maintainability and reduces code duplication. [1] [2] [3] [4]

Simplification of Package Selection Logic

  • Simplified the logic for determining which packages to install by replacing complex conditional expressions with lib.concatMap and lib.filter functions. This change ensures a cleaner and more readable configuration. [1] [2] [3] [4]

Removal of Redundant Configurations

  • Removed redundant or unused configurations, such as the emulators option in the browser module, consolidating functionality into the new mappings and package selection logic.

Miscellaneous Enhancements

  • Consolidated game-related configurations into a single games.nix file for better organization.
  • Updated the TODO.md file to reflect completed tasks and remove unnecessary items. [1] [2]## Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My commits follow conventional commit format
  • I have updated the documentation accordingly
  • My changes generate no new warnings

@ClementBobin ClementBobin requested a review from Copilot June 15, 2025 13:33
@ClementBobin ClementBobin self-assigned this Jun 15, 2025
@ClementBobin ClementBobin added the enhancement New feature or request label Jun 15, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 15, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for macOS configuration and deployment, including a sample macOS host and deployment script updates.
    • Introduced new modules for Discord integration, joystick support, and consolidated game management.
    • Added a new host configuration for "pine" with tailored hardware and user environment settings.
    • Enhanced Hyprland desktop configuration with new keybindings and autostart applications.
  • Refactor

    • Standardized and relocated module namespaces from "common" to "hm" or "system" for improved organization.
    • Unified and streamlined configuration options for games, containers, browsers, documentation, and antivirus, replacing multiple enable flags with list-based selection.
    • Simplified and modularized package selection logic across multiple modules.
  • Removals

    • Removed several legacy or redundant modules, including individual game modules, Portmaster, and host-specific drivers and RGB lighting modules.
    • Deprecated per-client enable flags in favor of list-based configuration for games and other services.
  • Bug Fixes

    • Improved path handling and quoting in ignore-file retrieval scripts.
    • Extended battery charge threshold handling for multiple batteries.
  • Chores

    • Updated host configurations to match new module structures and naming conventions.
    • Cleaned up outdated tasks and documentation references.

Summary by CodeRabbit

  • New Features

    • Added support for macOS configurations and deployment.
    • Introduced new host configuration for "pine".
    • Added new modules for Discord integration, joystick support, and consolidated games management.
    • Enhanced Hyprland desktop configuration with new keybindings and startup commands.
  • Improvements

    • Refactored configuration namespaces for clarity and consistency across modules.
    • Unified and simplified options for games, browsers, documentation, development tools, emulators, antivirus, password managers, containers, and network services.
    • Streamlined package selection and installation logic for various modules.
    • Improved session variable handling and alias definitions for development environments.
  • Removals

    • Removed legacy modules for individual games, drivers, Portmaster firewall, and Tailscale VPN.
    • Deleted redundant or replaced configuration files and options.
  • Bug Fixes

    • Corrected configuration paths and option declarations for better reliability and maintainability.

Walkthrough

This update performs a comprehensive refactor and namespace reorganization across the NixOS and Home Manager module hierarchy. It migrates module option paths from modules.common and similar namespaces to a unified modules.hm and modules.system structure. Numerous modules are updated to use dynamic mappings for package selection, pluralized and list-based configuration options, and improved conditional logic. Several new modules are added (e.g., Discord integration, consolidated games support, macOS support), while obsolete or redundant modules are removed. Host configurations are updated to match the new module structure, and deployment tooling is extended for new hosts and macOS.

Changes

File(s) / Group Change Summary
flake.nix Added macOS (nix-darwin) support, new hosts (pine), extended deployment tooling and checks.
hosts/pine/default.nix New NixOS host configuration for "pine" with hardware, user, and environment setup.
modules/hm/common/communication/discord.nix New module: Discord client/overlay/RPC options and package selection.
modules/hm/common/games/games.nix, joystick.nix New consolidated games module and joystick support module.
modules/hm/desktops/configHydenix.nix, hydenix.nix New Hyprland keybindings module and integration into user preferences.
modules/hm/common/games/minecraft.nix, roblox.nix, rocket-league.nix, star-citizen.nix, northstar.nix Removed legacy individual game modules (now consolidated).
modules/system/common/networks/portmaster.nix, vpn/tailscale.nix Removed Portmaster and legacy Tailscale VPN module.
modules/system/hosts/fern/drivers.nix, openrgb.nix Removed Fern host-specific drivers and OpenRGB modules.
modules/hm/common/*, modules/system/common/*, modules/system/hosts/fern/*, modules/system/hosts/oak/* Migrated configuration paths from modules.common/modules.dev/etc. to modules.hm/modules.system and updated option names/types for consistency.
modules/hm/common/*, modules/system/common/* (various) Refactored modules to use dynamic mappings for package selection, pluralized/list options, and streamlined conditional logic.
modules/hm/hosts/oak/default.nix, modules/system/hosts/oak/default.nix, modules/system/hosts/fern/default.nix Updated host configs to new module structure, renamed and refactored attributes, removed/added/renamed options as per new modules.
modules/system/common/networks/vpn.nix New VPN module supporting list-based VPN selection (currently Tailscale).
modules/system/common/games/games.nix Refactored to list-based gaming client selection, removed individual enable flags, added new client support.
modules/hm/common/default.nix, modules/system/common/default.nix Updated imports to match new module structure; consolidated and simplified imports.
Other modules/hm/common/*, modules/system/common/* Updated option paths, improved package selection logic, removed obsolete enable flags, pluralized options, improved environment/session variable management.

Sequence Diagram(s)

sequenceDiagram
    participant UserConfig
    participant HomeManager
    participant SystemModules
    participant Packages

    UserConfig->>HomeManager: Specify options (e.g., games, browser.clients, dev.tools)
    HomeManager->>SystemModules: Map options to package lists via dynamic mappings
    SystemModules->>Packages: Aggregate enabled package lists (deduped)
    Packages-->>HomeManager: Provide final package set
    HomeManager-->>UserConfig: Apply configuration (home.packages, session variables, etc.)
Loading
sequenceDiagram
    participant UserConfig
    participant DiscordModule
    participant Packages

    UserConfig->>DiscordModule: Set clients/overlays/rpc options
    DiscordModule->>Packages: Map selected options to package lists
    Packages-->>DiscordModule: Return package list
    DiscordModule-->>UserConfig: Add packages to home.packages if any selected
Loading

Possibly related PRs

  • Dev #4: Both PRs modify flake.nix to add deployment node configurations and deployment tooling integration. This PR, however, also introduces extensive module namespace reorganizations and new modules, so their overlap is mainly in deployment-related flake configuration.

Poem

🐇
Refactored paths and modules anew,
With mappings and lists, our options grew.
Games and browsers, all in a row,
Discord joins the party, with overlays in tow.
Mac and pine hosts hop into sight—
This rabbit’s configs feel just right!
🥕


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d02c122 and e56b489.

📒 Files selected for processing (4)
  • modules/hm/common/network/tunnel.nix (3 hunks)
  • modules/system/common/default.nix (2 hunks)
  • modules/system/common/games/gamescope.nix (0 hunks)
  • modules/system/hosts/oak/default.nix (2 hunks)
💤 Files with no reviewable changes (1)
  • modules/system/common/games/gamescope.nix
🔇 Additional comments (8)
modules/hm/common/network/tunnel.nix (3)

6-11: LGTM! Clean service-to-package mapping implementation.

The servicesToPackage mapping provides a clean, maintainable way to associate tunnel services with their required packages. This approach makes it easy to add new services in the future.


53-58: Excellent use of dynamic enum generation.

Using lib.attrNames servicesToPackage for the enum values ensures the service options stay in sync with the available package mappings automatically. This is a robust design pattern.


95-103: Clean configuration merge structure.

The modular approach using lib.mkMerge with separate conditional blocks for different services makes the configuration easy to understand and maintain.

modules/system/common/default.nix (2)

18-19: Good consolidation of network module imports.

The change from specific ./networks/vpn/tailscale.nix to general ./networks/vpn.nix and the addition of ./networks/wol.nix reflects the modularization improvements described in the PR objectives.


28-28: Import path simplification aligns with module restructuring.

The simplified path from ./virtualisation/containers/containers.nix to ./virtualisation/containers.nix is consistent with the broader refactoring to streamline module organization.

modules/system/hosts/oak/default.nix (3)

7-7: Namespace migration to modules.system completed successfully.

The change from modules to modules.system aligns with the systematic namespace reorganization described in the PR objectives.


16-20: Configuration updated to use new list-based options.

The changes to use list-based configurations (clients, networks.vpn, containers.engines) are consistent with the new mapping-driven approach implemented across the refactored modules.


28-28: Antivirus configuration aligned with new module design.

The change to engines = ["clamav"] follows the same pattern of moving from individual boolean options to list-based service selection.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch DEV

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

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 and enhances the Nix configuration modules by renaming the common namespace to hm, introducing reusable mappings for various package categories, and simplifying package selection logic via lib.filter and lib.concatMap. It also removes redundant settings and consolidates game modules into a single file.

  • Renamed all configuration paths from config.modules.common to config.modules.hm
  • Introduced *ToPackage maps for editors, browsers, CLI tools, and mail services
  • Simplified home package assembly logic and consolidated game modules

Reviewed Changes

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

Show a summary per file
File Description
modules/hm/common/documentation/default.nix Renamed config path, added editor-package map, simplified package list
modules/hm/common/dev/rust.nix Renamed config path for Rust dev
modules/hm/common/dev/python.nix Renamed config path for Python dev
modules/hm/common/dev/node/prisma.nix Renamed config path for Prisma
modules/hm/common/dev/node/pm2.nix Renamed config path for PM2
modules/hm/common/dev/node/node.nix Renamed config path for Node, kept package logic
modules/hm/common/dev/global-tools/nix.nix Renamed config path for Nix global tools
modules/hm/common/dev/global-tools/cli.nix Added CLI-to-package map, simplified package selection
modules/hm/common/dev/global-tools/act-github.nix Renamed config path for act-github
modules/hm/common/dev/editor/vs-code.nix Renamed config path for VS Code
modules/hm/common/dev/editor/jetbrains.nix Renamed config path for JetBrains IDEs
modules/hm/common/dev/editor/dbeaver.nix Renamed config path for DBeaver
modules/hm/common/dev/editor/android-studio.nix Renamed config path for Android Studio
modules/hm/common/dev/dotnet.nix Renamed config path for .NET, updated sdk-versions option
modules/hm/common/default.nix Consolidated individual game modules into games.nix
modules/hm/common/communication/teams.nix Renamed config path for Teams
modules/hm/common/communication/mail/default.nix Renamed config path, expanded mail-service mapping
modules/hm/common/communication/mail/bluemail.nix Removed unused cfg binding in bluemail module
modules/hm/common/browser/default.nix Renamed config path, added browser & driver maps, simplified packages
TODO.md Updated task status markers
Comments suppressed due to low confidence (2)

modules/hm/common/dev/dotnet.nix:6

  • Accessing an attribute with a hyphen using cfg.sdk-versions is interpreted as subtraction. Use quoted access cfg."sdk-versions" or rename the option to a hyphen-free key.
    sdkVersions = cfg.sdk-versions;

modules/hm/common/browser/default.nix:30

  • The code references cfg.driver.enable, but no driver option is declared under options.modules.hm.browser. Define a driver.enable option or guard this reference to avoid an evaluation error.
    drivers = lib.optionals cfg.driver.enable (

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 36

🔭 Outside diff range comments (17)
modules/system/common/hardware/autologin.nix (1)

11-23: 🛠️ Refactor suggestion

Make user and session mandatory & self-documenting

Both options default to null when no default is supplied.
Because they are dereferenced inside the cfg.enable branch, enabling the module without explicitly setting them will generate an invalid SDDM config ("null.desktop" / "null").

-  user = lib.mkOption {
-    type = lib.types.str;
-    description = "User to autologin";
-  };
+  user = lib.mkOption {
+    type = lib.types.nonEmptyStr;
+    description = "User to autologin";
+    example = "alice";
+    # No default → value is required when cfg.enable = true
+  };

-  session = lib.mkOption {
-    type = lib.types.str;
-    description = "Session to autologin";
-  };
+  session = lib.mkOption {
+    type = lib.types.nonEmptyStr;
+    description = "Desktop session (without .desktop suffix)";
+    example = "plasma";
+  };

Optionally, add an assertion to guarantee the suffix isn’t provided twice:

assertions = [{
  assertion = !lib.hasSuffix ".desktop" cfg.session;
  message   = "modules.system.hardware.autologin.session must be given without the .desktop suffix";
}];
modules/system/common/hardware/boot.nix (1)

20-24: ⚠️ Potential issue

Use lib.mkForce, not pkgs.lib.mkForce

pkgs.lib is deprecated in recent Nixpkgs; the canonical accessor is just lib.
The current line will still work but ties the expression to the host’s package set and can break if pkgs is overridden.

-      loader.systemd-boot.enable = pkgs.lib.mkForce false;
+      loader.systemd-boot.enable = lib.mkForce false;
modules/hm/common/dev/dotnet.nix (1)

4-13: ⚠️ Potential issue

Dynamic attribute access is syntactically invalid – Nix will fail to evaluate.

pkgs ? ${pkgName} and pkgs.${pkgName} cannot interpolate a variable in an attr-path.
Use a quoted string inside the attr-path instead.

-    (map (pkgName:
-      if pkgs ? ${pkgName}
-      then pkgs.${pkgName}
-      else throw "Package '${pkgName}' not found in pkgs"
+    (map (pkgName:
+      if pkgs ? "${pkgName}"
+      then pkgs."${pkgName}"
+      else throw "Package '${pkgName}' not found in pkgs"
     ) cfg.extraPackages);

Failing to fix this breaks home-manager evaluation as soon as extraPackages is non-empty.

modules/hm/common/shell/fzf.nix (1)

4-13: 🛠️ Refactor suggestion

Feature flag is ineffective – fzf is installed even when the module is disabled

home.packages is appended unconditionally. This defeats the purpose of the enable option introduced on line 8; users who explicitly disable the module will still get the package.

-  config.home.packages = (with pkgs; [
-    fzf
-  ]);
+  config = lib.mkIf cfg.enable {
+    home.packages = (with pkgs; [ fzf ]);
+  };

Applying the guard also aligns this module with the enable-gated pattern used elsewhere in the codebase (e.g. obs.nix).

modules/hm/common/extra/ignore-file-retriever.nix (1)

138-148: 🛠️ Refactor suggestion

Quote $watchDirs to avoid word-splitting when paths contain spaces

watchDirs is expanded unquoted inside the inotifywait command.
If any watched directory has a space the service will break because bash will
split the value into multiple arguments.

-          watchDirs = lib.concatStringsSep " " (
-            ["%h"] ++ map expandPath cfg.watchPaths
-          );
+          watchDirs = lib.concatStringsSep " " (
+            ["%h"] ++ map (p: lib.escapeShellArg (expandPath p)) cfg.watchPaths
+          );

and later:

-          "${pkgs.inotify-tools}/bin/inotifywait -m -r -e modify,move,create,delete \
-            --format '%w%f' ${watchDirs} | \
+          "${pkgs.inotify-tools}/bin/inotifywait -m -r -e modify,move,create,delete \
+            --format '%w%f' ${watchDirs} | \

(The variable is now already shell-escaped.)

modules/hm/common/communication/teams.nix (1)

12-14: 🧹 Nitpick (assertive)

Consider switching to the official Microsoft build

teams-for-linux is no longer actively maintained and has lagged behind the PWA
recommended by Microsoft. pkgs.teams (electron) or a PWA wrapper might give a
better UX and quicker updates.

modules/system/common/nix/linux-cachyos.nix (1)

24-30: 🧹 Nitpick (assertive)

Optional: co-locate substituter key with URL

Minor readability nit – co-locating the public key directly beneath its
matching substituter makes maintenance easier when multiple substituters are
present.

modules/hm/common/dev/python.nix (1)

79-82: 🛠️ Refactor suggestion

Guard against empty versions list

builtins.head cfg.versions throws if the list is empty. Either validate that
versions is non-empty or fall back gracefully.

-      default = builtins.head cfg.versions;
+      default = if cfg.versions != [] then builtins.head cfg.versions
+                else lib.mkDefault "312";
modules/system/common/backup/syncthing.nix (1)

35-43: ⚠️ Potential issue

lib.cleanSource will copy user data into the Nix store – remove it

lib.cleanSource is intended for build-time sources; applying it to a runtime path like ${cfg.dirSync}/${cfg.subDir} will try to import the whole directory (default “/”) into the store, which is huge and evaluation-time illegal.

-      dataDir = lib.cleanSource "${cfg.dirSync}/${cfg.subDir}";  # default location for new folders
+      # Use the path directly; no need to copy it to the Nix store
+      dataDir = "${cfg.dirSync}/${cfg.subDir}";

This prevents accidental mass copying and keeps the module evaluation fast and safe.

modules/system/common/dev/dev.nix (1)

9-34: 🧹 Nitpick (assertive)

Looks good – maybe allow consumers to extend nix-ld libraries

The rename to modules.system.dev.dev-global is correct.
For future extensibility, exposing the libraries list as an option (with a sensible default) would let users add project-specific shared objects without forking the module.

(Not blocking for this PR.)

modules/hm/common/engine/default.nix (1)

15-21: ⚠️ Potential issue

Option should live under modules.hm.engine, not at the root
Declaring:

options.modules.hm = { engine =; };

mixes values with sub-trees and may collide with other keys (dev, shell, …). Nest the option:

-options.modules.hm = {
-  engine = …
-};
+options.modules.hm.engine = lib.mkOption { … };

This keeps the namespace flat and predictable.

modules/hm/common/dev/node/pm2.nix (1)

12-14: ⚠️ Potential issue

pm2 attribute likely missing – use nodePackages.pm2.

In current nixpkgs the PM2 CLI lives under pkgs.nodePackages.pm2; there is no top-level pkgs.pm2.
Using the wrong attribute will break evaluation.

-    home.packages = (with pkgs; [
-      pm2
-    ]);
+    home.packages = (with pkgs; [
+      nodePackages.pm2
+    ]);
modules/hm/common/dev/node/prisma.nix (1)

12-15: ⚠️ Potential issue

Wrong package attribute – prisma is not top-level.

nixpkgs exports the CLI as pkgs.nodePackages.prisma (or, for engines, prisma-engines).
Referencing pkgs.prisma will fail at evaluation time.

-    home.packages = (with pkgs; [
-      prisma
-    ]);
+    home.packages = (with pkgs; [
+      nodePackages.prisma
+    ]);
modules/hm/common/dev/editor/android-studio.nix (1)

12-15: ⚠️ Potential issue

android-studio-tools attribute does not exist – replace with android-tools.

nixpkgs provides android-tools (adb/fastboot), not android-studio-tools.
Leaving the current name will break the build.

-      android-studio
-      android-studio-tools
+      android-studio
+      android-tools
modules/system/hosts/fern/wol.nix (2)

23-27: ⚠️ Potential issue

Dynamic interface key needs quoting – current syntax is invalid Nix.

Attribute paths cannot interpolate variables without quotes.
Evaluation will fail on interfaces.${cfg.interface}.

-      interfaces.${cfg.interface} = {
+      interfaces."${cfg.interface}" = {
         wakeOnLan.enable = true;
       };

30-48: 🧹 Nitpick (assertive)

Optional: unify ExecStart/ExecStop.

Both commands set WoL to g; ExecStop can be dropped or replaced with a true no-op to shorten the service definition.

modules/hm/common/emulator/default.nix (1)

76-80: 🧹 Nitpick (assertive)

WINEARCH hard-coded to win64

Some users still rely on 32-bit prefixes. Consider exposing an option
or inferring it from the chosen Wine package.

-  WINEARCH = "win64";
+  WINEARCH = cfg.wine.arch or "win64";

(where wine.arch is a new enum ["win64" "win32"]).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7535c23 and 7878c75.

📒 Files selected for processing (82)
  • TODO.md (1 hunks)
  • modules/hm/common/browser/default.nix (2 hunks)
  • modules/hm/common/communication/mail/bluemail.nix (0 hunks)
  • modules/hm/common/communication/mail/default.nix (1 hunks)
  • modules/hm/common/communication/teams.nix (1 hunks)
  • modules/hm/common/default.nix (1 hunks)
  • modules/hm/common/dev/dotnet.nix (2 hunks)
  • modules/hm/common/dev/editor/android-studio.nix (1 hunks)
  • modules/hm/common/dev/editor/dbeaver.nix (1 hunks)
  • modules/hm/common/dev/editor/jetbrains.nix (1 hunks)
  • modules/hm/common/dev/editor/vs-code.nix (1 hunks)
  • modules/hm/common/dev/global-tools/act-github.nix (1 hunks)
  • modules/hm/common/dev/global-tools/cli.nix (1 hunks)
  • modules/hm/common/dev/global-tools/nix.nix (1 hunks)
  • modules/hm/common/dev/node/node.nix (2 hunks)
  • modules/hm/common/dev/node/pm2.nix (1 hunks)
  • modules/hm/common/dev/node/prisma.nix (1 hunks)
  • modules/hm/common/dev/python.nix (2 hunks)
  • modules/hm/common/dev/rust.nix (1 hunks)
  • modules/hm/common/documentation/default.nix (1 hunks)
  • modules/hm/common/documentation/obsidian.nix (2 hunks)
  • modules/hm/common/emulator/default.nix (3 hunks)
  • modules/hm/common/engine/default.nix (2 hunks)
  • modules/hm/common/extra/ignore-file-retriever.nix (2 hunks)
  • modules/hm/common/games/games.nix (1 hunks)
  • modules/hm/common/games/joystick.nix (1 hunks)
  • modules/hm/common/games/mangohud.nix (1 hunks)
  • modules/hm/common/games/minecraft.nix (0 hunks)
  • modules/hm/common/games/northstar.nix (0 hunks)
  • modules/hm/common/games/roblox.nix (0 hunks)
  • modules/hm/common/games/rocket-league.nix (0 hunks)
  • modules/hm/common/games/star-citizen.nix (0 hunks)
  • modules/hm/common/multimedia/gimp.nix (1 hunks)
  • modules/hm/common/multimedia/mpv.nix (1 hunks)
  • modules/hm/common/multimedia/obs.nix (1 hunks)
  • modules/hm/common/multimedia/openshot-qt.nix (1 hunks)
  • modules/hm/common/multimedia/parsec.nix (1 hunks)
  • modules/hm/common/multimedia/stremio.nix (1 hunks)
  • modules/hm/common/network/tunnel.nix (3 hunks)
  • modules/hm/common/shell/btop.nix (1 hunks)
  • modules/hm/common/shell/disk-usage.nix (1 hunks)
  • modules/hm/common/shell/fzf.nix (1 hunks)
  • modules/hm/common/shell/navi.nix (1 hunks)
  • modules/hm/common/shell/ranger.nix (1 hunks)
  • modules/hm/common/shell/starship.nix (1 hunks)
  • modules/hm/common/shell/tools.nix (1 hunks)
  • modules/hm/common/utilities/filezilla.nix (1 hunks)
  • modules/hm/common/utilities/kde-connect.nix (1 hunks)
  • modules/hm/common/utilities/scalar.nix (2 hunks)
  • modules/hm/common/utilities/stacer.nix (1 hunks)
  • modules/hm/desktops/configHydenix.nix (1 hunks)
  • modules/hm/desktops/hydenix.nix (3 hunks)
  • modules/hm/hosts/oak/default.nix (4 hunks)
  • modules/system/common/backup/syncthing.nix (1 hunks)
  • modules/system/common/default.nix (2 hunks)
  • modules/system/common/dev/dev.nix (1 hunks)
  • modules/system/common/dev/flatpak.nix (1 hunks)
  • modules/system/common/dev/flutter.nix (2 hunks)
  • modules/system/common/dev/php.nix (1 hunks)
  • modules/system/common/games/games.nix (3 hunks)
  • modules/system/common/games/gamescope.nix (1 hunks)
  • modules/system/common/hardware/autologin.nix (1 hunks)
  • modules/system/common/hardware/boot.nix (1 hunks)
  • modules/system/common/hardware/powersave.nix (2 hunks)
  • modules/system/common/networks/portmaster.nix (0 hunks)
  • modules/system/common/networks/print/print.nix (1 hunks)
  • modules/system/common/networks/vpn.nix (1 hunks)
  • modules/system/common/networks/vpn/tailscale.nix (0 hunks)
  • modules/system/common/nix/linux-cachyos.nix (1 hunks)
  • modules/system/common/nix/nix-garbage.nix (1 hunks)
  • modules/system/common/nix/polkit.nix (1 hunks)
  • modules/system/common/security/antivirus.nix (1 hunks)
  • modules/system/common/security/password-manager.nix (1 hunks)
  • modules/system/common/virtualisation/containers.nix (1 hunks)
  • modules/system/hosts/fern/default.nix (1 hunks)
  • modules/system/hosts/fern/drivers.nix (2 hunks)
  • modules/system/hosts/fern/openrgb.nix (0 hunks)
  • modules/system/hosts/fern/plex.nix (1 hunks)
  • modules/system/hosts/fern/sunshine.nix (1 hunks)
  • modules/system/hosts/fern/vfio/default.nix (2 hunks)
  • modules/system/hosts/fern/wol.nix (1 hunks)
  • modules/system/hosts/oak/default.nix (1 hunks)
💤 Files with no reviewable changes (9)
  • modules/hm/common/communication/mail/bluemail.nix
  • modules/hm/common/games/northstar.nix
  • modules/hm/common/games/star-citizen.nix
  • modules/hm/common/games/roblox.nix
  • modules/hm/common/games/minecraft.nix
  • modules/system/common/networks/vpn/tailscale.nix
  • modules/hm/common/games/rocket-league.nix
  • modules/system/common/networks/portmaster.nix
  • modules/system/hosts/fern/openrgb.nix
🔇 Additional comments (49)
modules/hm/common/utilities/stacer.nix (1)

4-8:

Details

✅ Verification successful

Namespace migration looks correct — check for dangling references

cfg and the options block now point to modules.hm.utilities.stacer, matching the new convention.
Please scan the codebase for any leftover modules.common.utilities.stacer references to avoid silent mis-configuration at runtime.


🏁 Script executed:

#!/usr/bin/env bash
# Find stale references to the old namespace.
rg -n $'modules\\.common\\.utilities\\.stacer'

Length of output: 44


Let's broaden the search to catch any stray references under common.utilities.stacer:


🏁 Script executed:

#!/usr/bin/env bash
# Double-check for any leftover references to the old namespace
rg -n 'common\\.utilities\\.stacer'

Length of output: 37


No stale references to the old namespace detected
A repository-wide search for both modules.common.utilities.stacer and common.utilities.stacer returned no matches. The namespace migration is complete.

modules/hm/common/utilities/filezilla.nix (1)

4-5:

Details

✅ Verification successful

Verify that all call-sites were migrated to the new namespace

cfg = config.modules.hm.utilities.filezilla switches from the old modules.common.* path. Any stale references will silently disable this module.

Run a quick grep to be safe:


🏁 Script executed:

#!/usr/bin/env bash
# Look for forgotten usages of the old namespace
rg -n --no-heading $'modules\\.common\\.utilities\\.filezilla'

Length of output: 60


🏁 Script executed:

#!/usr/bin/env bash
# Double‐check for any lingering old namespace references with the config prefix
rg -n --no-heading 'config\.modules\.common\.utilities\.filezilla'

Length of output: 68


No stale modules.common.utilities.filezilla references remain

I ran a grep for both

rg -n --no-heading 'modules\.common\.utilities\.filezilla'
rg -n --no-heading 'config\.modules\.common\.utilities\.filezilla'

and found zero matches. All call-sites have been successfully migrated to config.modules.hm.utilities.filezilla.

modules/system/common/hardware/autologin.nix (1)

7-9:

Details

✅ Verification successful

Ensure all callers were migrated to the new namespace

cfg now points to config.modules.system.hardware.autologin.
Any leftover references to the former config.modules.hardware.autologin path will silently evaluate to null and break autologin at runtime.

Run the following to confirm that no files still use the old namespace:


🏁 Script executed:

#!/bin/bash
# Find occurrences of the outdated path.
rg -n "modules[.]hardware[.]autologin" --glob '*.nix'

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Re-verify references to the old autologin namespace, including the config prefix.
rg -n "modules\\.hardware\\.autologin" --glob '*.nix'
rg -n "config\\.modules\\.hardware\\.autologin" --glob '*.nix'

Length of output: 115


All autologin references updated to the new namespace

A full search for config.modules.hardware.autologin in .nix files returned no matches. The migration to config.modules.system.hardware.autologin is complete—no further changes are needed.

modules/system/common/nix/nix-garbage.nix (1)

4-7:

Details

✅ Verification successful

Double-check for stale references in the tree

Please grep the repo for modules.nix.nix-garbage to ensure no callers still rely on the old path.


🏁 Script executed:

#!/usr/bin/env bash
# Find any lingering references to the old garbage-collector path
rg --line-number --color=always $'modules\\.nix\\.nix-garbage'

Length of output: 61


No stale references to modules.system.nix.nix-garbage found
Ran the ripgrep search below and confirmed there are no lingering callers of the old path:

rg --line-number 'modules\.nix\.nix-garbage'

No matches were detected—this change can be considered safe.

modules/hm/common/dev/editor/dbeaver.nix (1)

4-8: HM namespace switch LGTM – verify consumers

The switch to modules.hm.dev.editor.dbeaver is consistent with the broader refactor. Make sure every host/user configuration that previously set modules.common.dev.editor.dbeaver.enable is updated, otherwise the module will silently disable.

modules/hm/common/dev/global-tools/nix.nix (1)

4-8:

Details

✅ Verification successful

Path realignment OK – run a quick repo-wide sweep

The new modules.hm.dev.global-tools.nix path compiles, but a stray reference to the old modules.common.dev.global-tools.nix will break enablement.


🏁 Script executed:

#!/usr/bin/env bash
rg --line-number --color=always $'modules\\.common\\.dev\\.global-tools\\.nix'

Length of output: 75


No stray references to the old path found
A repo-wide sweep with

rg --line-number --color=always 'modules\.common\.dev\.global-tools\.nix'

returned no matches, confirming the path realignment is complete.

modules/hm/common/shell/btop.nix (1)

4-8: Shell module namespace updated – good

Change is straightforward and consistent. No functional issues spotted.

modules/hm/common/multimedia/stremio.nix (1)

4-8:

Details

✅ Verification successful

Namespace refactor looks correct – please sweep for lingering callers

cfg and the option path are migrated to modules.hm.multimedia.stremio, matching the new convention.
Please run a quick repo-wide search to ensure no module or overlay still references the old modules.common.multimedia.stremio path; stale references will silently disable the option.


🏁 Script executed:

#!/usr/bin/env bash
# Find any leftover usages of the old namespace
rg -n $'modules\\.common\\.multimedia\\.stremio'

Length of output: 46


Namespace refactor verified – no lingering callers found
I ran a repo-wide search for the old modules.common.multimedia.stremio path and found no matches. The namespace has been fully migrated to modules.hm.multimedia.stremio, so no further action is needed.

  • No occurrences of modules.common.multimedia.stremio in the codebase.
modules/hm/common/multimedia/gimp.nix (1)

4-8:

Details

❓ Verification inconclusive

Consistent rename applied – double-check downstream references

The switch to modules.hm.multimedia.gimp mirrors the rest of the multimedia refactor.
Same verification concern as above: confirm that no file, README, or example configuration still uses the old path.


🏁 Script executed:

#!/usr/bin/env bash
rg -n $'modules\\.common\\.multimedia\\.gimp'

Length of output: 43


#!/usr/bin/env bash

Search for any lingering references to the old path in code, docs, or examples

rg -n 'modules.common.multimedia.gimp|common.multimedia.gimp'


Consistent rename applied – verify no leftover references

I searched for modules.common.multimedia.gimp and found no matches. To ensure nothing slipped through, please also check for the slash-based path in docs and example configs:

rg -n 'modules\.common\.multimedia\.gimp|modules/common/multimedia/gimp'
modules/system/common/hardware/boot.nix (1)

9-15:

Details

❓ Verification inconclusive

Path renamed correctly – remember to migrate imports & docs

The option tree now lives under modules.system.hardware.boot. Ensure all imports = [ … ] lists in flake.nix / nixosConfiguration files are updated accordingly, otherwise the module will never be instantiated.


🏁 Script executed:

#!/usr/bin/env bash
rg -n $'modules\\.hardware\\.boot' --glob '*.nix'

Length of output: 48


Verify imports for the renamed boot module

We didn’t find any occurrences of modules.hardware.boot in your .nix files, but absence of matches isn’t proof there are no stale paths. Please manually audit all imports = [ … ] blocks in:

  • flake.nix (and any other flake overlays)
  • Your nixosConfiguration files

Ensure any import of

modules/system/common/hardware/boot.nix

(or older path references) is updated to the new location under

modules.system.hardware.boot

Otherwise the module will not be instantiated.

modules/hm/common/dev/dotnet.nix (1)

17-17: Namespace switch looks correct.

The option tree has been migrated to modules.hm.dev.dotnet; matches the cfg path above.

modules/system/common/dev/flutter.nix (1)

4-4: Namespace update is sound.

The move to modules.system.dev.flutter is consistent with the new hierarchy; no functional impact.

Also applies to: 15-15

modules/hm/common/shell/starship.nix (1)

9-9: Starship module path updated correctly.

No other behavioural changes – LGTM.

Also applies to: 12-12

modules/system/common/dev/php.nix (1)

4-9: Namespace change looks good.

The PHP dev environment is now under modules.system.dev.php; nothing else altered.

modules/hm/common/multimedia/obs.nix (1)

4-8: Namespace update looks correct

The move to modules.hm.multimedia.obs is consistent with the wider refactor and does not introduce functional changes.

modules/system/common/dev/flatpak.nix (1)

9-13:

Details

✅ Verification successful

Double-check for stale references to the old modules.dev.flatpak path

The rename is fine, but any forgotten imports/options will now break evaluation.

Run a quick search to catch leftovers:


🏁 Script executed:

#!/bin/bash
# List files still referring to the old namespace
rg -n $'modules\.dev\.flatpak'

Length of output: 31


No stale references to the old modules.dev.flatpak namespace
A search for modules.dev.flatpak returned no matches—there are no remaining imports or options to update.

modules/hm/common/utilities/kde-connect.nix (1)

6-10: Namespace change acknowledged – no additional issues spotted

The path update to modules.hm.utilities.kde-connect is consistent with the refactor; logic remains sound.

modules/hm/common/multimedia/parsec.nix (1)

4-8: Path migration looks good

The Parsec module correctly adopts the new modules.hm.multimedia namespace; behaviour unchanged.

modules/hm/common/extra/ignore-file-retriever.nix (1)

4-5: Namespace update looks correct.

The rename to modules.hm keeps the module in sync with the refactor. No additional issues spotted.

modules/hm/common/communication/teams.nix (1)

4-8: LGTM – namespace bump only

The change to modules.hm.communication.teams is consistent with the new naming
scheme.

modules/hm/common/shell/navi.nix (1)

4-8: Namespace update confirmed

The option path update matches the repo-wide refactor. No functional changes.

modules/system/common/nix/linux-cachyos.nix (1)

10-17: Correct move to modules.system.nix.*

The cfg path and options block were updated consistently. Looks good.

modules/hm/common/dev/python.nix (1)

5-6: Path refactor looks good

cfg now targets modules.hm.dev.python; everything else compiles.

modules/hm/common/shell/ranger.nix (1)

3-15: Namespace change looks safe – double-check parent imports

The switch to modules.hm.shell.ranger is consistent with the new hierarchy and the conditional block is still correct.
Please make sure every higher-level imports = [ … ] list (e.g. modules/hm/common/default.nix or any flake overlay) has been updated to point at the new location, otherwise the option set will be silently ignored at evaluation time.
No other issues spotted.

modules/hm/common/dev/global-tools/act-github.nix (1)

3-14: LGTM

Path update aligns with the new hierarchy and the conditional package inclusion is intact.
No further action required.

modules/hm/common/documentation/obsidian.nix (1)

4-4: Namespace update looks correct
The move to modules.hm.documentation.obsidian is consistent with the repo-wide rename; nothing else changes functionally.

Also applies to: 122-158

modules/hm/common/shell/tools.nix (1)

4-8: LGTM – namespace bump only
The path change to modules.hm.shell.tools is straightforward and keeps behaviour intact.

modules/system/common/security/password-manager.nix (1)

7-10: Keep backend list in sync with the mapping

Same remark as for the CLI module: the enum can be derived automatically.

-        type = lib.types.listOf (lib.types.enum (builtins.attrNames passwordManagerToPackage));
+        type = lib.types.listOf (lib.types.enum (builtins.attrNames passwordManagerToPackage));

(Just highlighting; you already do this here—good job.)

TODO.md (1)

11-11: No code impact – skipping.

modules/system/hosts/fern/default.nix (1)

12-30: Confirm OpenRGB removal & new namespace compile

openrgb.nix import was dropped and the subtree moved under modules.system.
Please run a nixos-rebuild dry-run for host fern to ensure:

  1. No residual references to the removed OpenRGB options remain.
  2. All nested attributes (modules.system.games, modules.system.fern.*) are defined by the refactored modules and do not clash.

Let me know if you need a quick grep script to verify this automatically.

modules/hm/common/dev/node/node.nix (1)

4-4:

Details

✅ Verification successful

Verify downstream references after namespace migration

The option path has been migrated to modules.hm.dev.node.
Please make sure:

  1. All declarations in home.nix or higher-level overlays now use the new path.
  2. Any cfg = config.modules.common.dev.node bindings that might still exist in sibling modules are cleaned up.

You can quickly validate with:

Also applies to: 30-30


🏁 Script executed:

#!/usr/bin/env bash
# Find remaining references to the old namespace
rg -n $'modules\\.common\\.dev\\.node'

Length of output: 36


Confirmed: No remaining references to modules.common.dev.node
Ran rg -n 'modules\.common\.dev\.node' against the codebase and found no matches. All declarations now use modules.hm.dev.node, so no further updates are required.

modules/system/hosts/fern/drivers.nix (1)

10-10: Cross-check host configuration after moving to modules.system.*

cfg and the option set were re-rooted under modules.system.fern.drivers.
Confirm that the host’s configuration.nix (or any imports) has been updated accordingly; otherwise the option will silently be ignored and the driver stack won’t activate.

Also applies to: 19-19

modules/system/hosts/fern/vfio/default.nix (1)

10-10: Namespace change looks good – remember to adjust overrides

The VFIO module now lives under modules.system.fern.vfio.
Double-check any mkOverride, mkAfter, or mkForce statements in other fern-specific modules that still target the old path.

Also applies to: 26-26

modules/hm/common/utilities/scalar.nix (1)

6-6: Consistent with HM namespace – LGTM

Scalar’s option path has been correctly migrated to modules.hm.utilities.scalar, and the remaining code already uses the new cfg. No further action required.

Also applies to: 65-65

modules/hm/common/dev/node/pm2.nix (1)

4-8: Namespace refactor looks sound.

cfg and the option path were migrated to the new modules.hm hierarchy consistently with the rest of the tree.
No functional regressions spotted here.

modules/hm/common/dev/node/prisma.nix (1)

4-8: Namespace refactor OK.

The option path update is consistent with the new layout.

modules/hm/common/dev/editor/android-studio.nix (1)

4-8: Namespace change consistent.

No issues with the refactor itself.

modules/system/common/default.nix (1)

18-28: Verify new import paths exist.

./networks/vpn.nix and ./virtualisation/containers.nix must have been moved/created in the same commit; otherwise the system config will fail to evaluate.

Please run nixos-rebuild dry-run (or equivalent CI eval) to confirm the paths resolve.

modules/system/common/networks/vpn.nix (1)

20-22: Good, declarative toggle for Tailscale

The conditional service enablement is concise and idiomatic. 👍

modules/system/common/virtualisation/containers.nix (2)

14-18: Nice pluralisation & list-based refactor

Moving from a single enum to engines as a list greatly improves flexibility. No issues spotted here.


21-33: Verify vars.user is always defined

users.groups.docker.members = [ "${vars.user}" ]; will raise an evaluation error if vars.user is unset for some hosts.
Please ensure every consuming host defines vars.user, or guard the assignment:

(lib.mkIf (vars ? user) {
  users.groups.docker.members = [ vars.user ];
})
modules/hm/common/communication/mail/default.nix (1)

8-12: Mapping now returns lists – good call

Wrapping each package in a list simplifies later flattening. Implementation looks solid.

modules/hm/common/games/games.nix (1)

8-11: Verify necessity of heavy toolchain packages

Including gcc and glibc in home.packages for Minecraft inflates closure size by hundreds of MB. Unless these are strictly required at runtime (e.g., PrismLauncher cannot resolve them from the system), consider dropping them or using pkgs.stdenv.cc.cc.lib.

modules/hm/hosts/oak/default.nix (1)

20-26: Does games.mangohud exist in the new games module?

modules.hm.games was consolidated into a single games.nix, but this host file still references games.mangohud. Unless there is a separate mangohud.nix providing that option, this path will now be undefined and evaluation will fail.

modules/hm/common/browser/default.nix (1)

30-35: Driver gating and deduplication look solid

drivers is conditionally included via lib.optionals and the final home.packages list is deduplicated with lib.unique. Nice!

modules/system/hosts/oak/default.nix (2)

15-17: Ensure host config tracks future schema changes

The host now opts into

modules.system.games.clients = [ "steam" "lutris" ];
modules.system.networks.vpn   = [ "tailscale" ];

Good, but keep an eye on the upstream modules: if they rename vpnvpns (plural) or add validation against unknown strings, this host profile will break at evaluation time.


24-29: Antivirus GUI flag aligns with new module – LGTM

gui.enable = true; matches the option introduced in the refactored antivirus module.

modules/hm/common/emulator/default.nix (1)

27-33: 🧹 Nitpick (assertive)

Package duplication still possible – wrap with lib.unique earlier

baseEmulatorPackages is later de-duplicated via lib.unique, but additionalPackages
can already contain Wine or Proton packages included in baseEmulatorPackages
(e.g. if someone wrongly adds "proton" to emulators and also sets proton.enable = true).

A simpler, always-unique expression avoids that:

-  home.packages = lib.unique (baseEmulatorPackages ++ additionalPackages);
+  home.packages = lib.unique (
+    baseEmulatorPackages
+    ++ additionalPackages
+  );

Minor, yet keeps deterministic ordering.

Likely an incorrect or invalid review comment.

modules/system/common/games/games.nix (1)

74-84: programs.gamemode.settings.custom is not a recognised key

Upstream programs.gamemode.settings only accepts the INI-sections
general, gpu, custom commands must be placed under general as
start / end. Verify with:

nixpkgs#programs.gamemode

Adjust or HM will fail to evaluate.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
modules/system/common/dev/flutter.nix (1)

47-72: Consider adding PATH configuration for Flutter development tools.

The current configuration sets environment variables but doesn't appear to modify PATH to include Flutter SDK, Android SDK tools, or Java binaries. This could cause issues where Flutter commands and related tools aren't accessible from the shell.

Consider adding PATH modifications to ensure development tools are accessible:

 config = lib.mkIf cfg.enable {
   environment.systemPackages =
     [
       pkgs.flutter
       cfg.jdkPackage
     ]
     ++ lib.optional cfg.withAndroid androidSdk;

   # Environment variables
   environment.variables = lib.mkMerge [
     { JAVA_HOME = "${cfg.jdkPackage}"; }
     #{ STUDIO_JDK = "${cfg.jdkPackage}"; }
     (lib.mkIf cfg.withAndroid {
       ANDROID_HOME = "${androidSdk}/libexec/android-sdk";
     })
   ];

+  # Add development tools to PATH
+  environment.systemPath = lib.mkMerge [
+    [ "${pkgs.flutter}/bin" ]
+    [ "${cfg.jdkPackage}/bin" ]
+    (lib.mkIf cfg.withAndroid [
+      "${androidSdk}/libexec/android-sdk/tools"
+      "${androidSdk}/libexec/android-sdk/platform-tools"
+    ])
+  ];

   programs = lib.mkIf cfg.withAndroid { adb.enable = true; };

Alternatively, if PATH modification was intentionally removed due to system-level package management, please document this architectural decision.

♻️ Duplicate comments (2)
modules/hm/desktops/hydenix.nix (1)

124-125: Duplicate keybinding overrides the first command

This issue was already identified in previous reviews. Hyprland keeps the last bind for a given key; therefore ALT+Tab will only execute bringactivetotop, silently dropping cyclenext. Combine the actions or remove the duplicate.

modules/hm/common/default.nix (1)

35-37: Game module consolidation is effective, but consider import grouping.

The replacement of individual game modules with a consolidated games.nix approach reduces code duplication and improves maintainability. However, the game-related imports could be better grouped for readability.

As noted in the previous review, consider grouping the three game-related imports together:

-    ./games/joystick.nix
-    ./games/mangohud.nix
-    ./games/games.nix
+    ./games/games.nix
+    ./games/joystick.nix
+    ./games/mangohud.nix
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7878c75 and 68c56af.

📒 Files selected for processing (8)
  • modules/hm/common/communication/discord.nix (1 hunks)
  • modules/hm/common/default.nix (2 hunks)
  • modules/hm/common/dev/node/prisma.nix (2 hunks)
  • modules/hm/common/dev/python.nix (3 hunks)
  • modules/hm/desktops/hydenix.nix (3 hunks)
  • modules/hm/hosts/oak/default.nix (3 hunks)
  • modules/system/common/dev/flutter.nix (3 hunks)
  • modules/system/hosts/oak/default.nix (1 hunks)
🔇 Additional comments (20)
modules/hm/desktops/hydenix.nix (3)

12-13: Good modularization approach.

The import of the external configuration module with proper argument passing follows NixOS best practices for separating concerns and improving maintainability.


96-96: Clean configuration injection.

Using the imported module's keybindings via string interpolation is an effective way to modularize the configuration while maintaining readability.


127-127: Reasonable autostart configuration.

The exec-once command with a delay is a good practice for ensuring the desktop environment is fully loaded before launching applications.

modules/system/common/dev/flutter.nix (2)

4-4: LGTM: Namespace migration aligns with PR objectives.

The migration from modules.dev.flutter to modules.system.dev.flutter is consistent with the broader refactoring described in the PR objectives to reorganize module hierarchies.

Also applies to: 15-15


59-59: Verify impact of commenting out STUDIO_JDK environment variable.

The STUDIO_JDK environment variable has been commented out, which could affect Android Studio's JDK detection if it's installed on the system. Android Studio typically uses this variable to determine which JDK to use for projects.

Please verify if this change is intentional and won't break Android Studio integration:

#!/bin/bash
# Description: Check if Android Studio configuration or other modules set STUDIO_JDK
# Expected: Find alternative STUDIO_JDK configuration or confirm it's no longer needed

echo "Searching for STUDIO_JDK references in the codebase..."
rg -A 3 -B 3 "STUDIO_JDK"

echo "Searching for Android Studio related configurations..."
rg -A 5 -B 5 -i "android.?studio"
modules/hm/common/dev/node/prisma.nix (2)

4-4: LGTM: Namespace refactoring is consistent with PR objectives.

The namespace changes from modules.common to modules.hm align with the broader module hierarchy refactoring described in the PR objectives.

Also applies to: 7-7


17-23: Verify Prisma environment variables and package dependency consistency.

The addition of Prisma engine environment variables is a valuable enhancement that helps Prisma locate its engines when installed via Nix. However, please verify the following:

  1. Package dependency: The module installs prisma but references prisma-engines in environment variables. Ensure both packages are available and this approach is correct.
  2. Environment variable correctness: Confirm these are the standard Prisma environment variable names.
  3. Hardcoded checksum ignore: The PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING = 1 should be verified as appropriate for this use case.
#!/bin/bash
# Description: Verify Prisma packages and environment variables in nixpkgs

# Check if both prisma and prisma-engines packages exist
echo "Checking nixpkgs for Prisma packages..."
rg -A 5 "pname.*=.*\"prisma\"" 
rg -A 5 "pname.*=.*\"prisma-engines\""

# Search for standard Prisma environment variable usage
echo "Searching for Prisma environment variables in nixpkgs..."
rg "PRISMA_.*ENGINE.*BINARY"
rg "PRISMA_ENGINES_CHECKSUM"
modules/hm/common/default.nix (1)

9-9: New Discord module integration looks good.

The addition of the Discord communication module aligns well with the modular structure and follows the established pattern for communication tools.

modules/hm/common/communication/discord.nix (1)

7-15: Discord client mappings look comprehensive.

The client-to-package mapping covers a good range of Discord variants from stable to development versions, including alternative clients like cordless and discordo.

modules/system/hosts/oak/default.nix (3)

7-7: Namespace migration executed correctly.

The change from modules to modules.system aligns with the PR's objective to establish a consistent hierarchical organization.


15-17: List-based configuration improves flexibility.

The migration from boolean flags to list-based configurations (e.g., games.clients = ["steam"], networks.vpn = ["tailscale"]) provides better extensibility and follows the data-driven approach established throughout the refactoring.


25-25: Antivirus engines list configuration is consistent.

The change to engines = ["clamav"] follows the same pattern as other module consolidations, allowing for multiple antivirus engines to be configured simultaneously.

modules/hm/common/dev/python.nix (2)

5-5: Namespace migration properly implemented.

The change from config.modules.common.dev.python to config.modules.hm.dev.python is consistent with the broader refactoring effort.


29-29: Options namespace updated correctly.

The options declaration follows the new namespace structure while preserving all the existing configuration capabilities.

modules/hm/hosts/oak/default.nix (6)

11-11: Home Manager namespace migration properly executed.

The change from config.modules.common to config.modules.hm is consistent with the refactoring objectives and maintains configuration compatibility.


24-24: Games configuration simplification is effective.

The migration from minecraft.enable to enabledGames = ["minecraft"] provides better scalability and aligns with the consolidated games module approach.


31-31: Browser client configuration follows established pattern.

The rename from emulators to clients and the list-based approach is consistent with other module refactoring in the PR.


57-57: Python configuration appropriately simplified.

The removal of nested devShell.enable configuration aligns with the simplification of the Python module, removing the shell environment generation functionality.


62-62: Discord RPC integration properly configured.

The addition of discord.rpc.enable = true correctly utilizes the new Discord module's RPC functionality.


65-67: Network tunnel configuration follows data-driven approach.

The migration to services = ["localtunnel"] with service-specific configuration maintains functionality while providing better extensibility for multiple tunnel services.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (15)
flake.nix (1)

147-147: Update usage message to include pine option.

The usage message still shows the old options and doesn't include pine, as noted in the previous review.

-        *) echo "Usage: rb [oak|fern|all]" >&2; exit 1 ;;
+        *) echo "Usage: rb [oak|fern|pine|all]" >&2; exit 1 ;;
modules/hm/common/documentation/default.nix (1)

12-15: Use lib.unique to avoid duplicate packages

The past review comment about using lib.unique to prevent duplicate packages is still applicable. Multiple editors could potentially share the same package dependencies.

modules/hm/common/default.nix (1)

35-37: Consider grouping game imports for consistency

The past review comment about grouping the game-related imports together is still applicable for improved readability.

modules/system/hosts/fern/sunshine.nix (1)

8-12: Consider backward compatibility and IPv6 support

The past review comments about adding an alias for backward compatibility and including IPv6 firewall rules alongside the existing IPv4 rules are still relevant considerations.

modules/hm/common/dev/rust.nix (2)

8-10: Critical type mismatch remains unresolved

The error handling with abort suggests awareness of the underlying issue, but the fundamental problem persists: extraPackages is declared as listOf package but used as listOf str for package name lookups.

Fix the type declaration to match usage:

extraPackages = lib.mkOption {
-  type = lib.types.listOf lib.types.package;
+  type = lib.types.listOf lib.types.str;

8-10: Performance: Wrap expensive computation in conditional

The rustPackages computation runs unconditionally, causing unnecessary work when the module is disabled.

Move the computation inside the config conditional:

-rustPackages = rustDefaultPackages
-  ++ (map (pkgName: pkgs.${pkgName} or (abort "Unknown Rust pkg: ${pkgName}"))
-        cfg.extraPackages);

in
{
  # options...
  
  config = lib.mkIf cfg.enable {
+    home.packages = rustDefaultPackages
+      ++ (map (pkgName: pkgs.${pkgName} or (abort "Unknown Rust pkg: ${pkgName}"))
+            cfg.extraPackages);
-    home.packages = rustPackages;
  };
modules/hm/common/communication/mail/default.nix (1)

14-15: Unresolved: Add deduplication for package safety

The previous review comment about potential duplicates from lib.concatMap remains unaddressed. While unlikely with current services, adding lib.unique would prevent future issues.

-packagesToInstall = lib.concatMap (service: serviceToPackage.${service}) serviceList;
+packagesToInstall = lib.unique (lib.concatMap (service: serviceToPackage.${service}) serviceList);
modules/hm/common/engine/default.nix (1)

4-4: Unresolved: cfg scope is too broad

The previous review comment about cfg = config.modules.hm being too broad remains unaddressed, creating potential naming conflicts.

-cfg = config.modules.hm;
+cfg = config.modules.hm.engine;
modules/hm/common/dev/global-tools/cli.nix (1)

27-27: Addresses previous review: Deduplication with lib.unique

The addition of lib.unique properly addresses the previous review comment about preventing duplicate packages in home.packages.

modules/system/common/security/antivirus.nix (2)

6-10: Early evaluation issue persists

The engineToPackages mapping still references cfg.gui.enable before the options are defined, which can cause evaluation loops or "access to undefined option" errors.

Consider refactoring to avoid this recursion risk:

-  engineToPackages = {
-    clamav = [ pkgs.clamav ] ++ lib.optionals cfg.gui.enable [ pkgs.clamtk ];
-    sophos = [ pkgs.sophos-av ];
-  };
+  staticEnginePkgs = {
+    clamav = [ pkgs.clamav ];
+    sophos = [ pkgs.sophos-av ];
+  };
+
+  engineToPackages = lib.mapAttrs
+    (_: pkgs: pkgs ++ lib.optionals cfg.gui.enable [ pkgs.clamtk ])
+    staticEnginePkgs;

12-12: UX improvement: "none" handling

The filtering of "none" from enabled engines is better than before, but since the default is now an empty list, the "none" option becomes redundant. Consider removing it entirely from the enum for clearer UX.

modules/hm/common/network/tunnel.nix (2)

28-35: Apply lib.unique to prevent duplicate packages.

The aggregated servicesPackages may contain duplicates if a service appears multiple times in cfg.services, which could cause Home-Manager issues.

Apply this diff to prevent duplicate packages:

-      home.packages = servicesPackages;
+      home.packages = lib.unique servicesPackages;
       home.shellAliases = enabledAliases;

36-45: Directory creation is still missing for generated files.

The file configurations assume parent directories exist, but Home-Manager doesn't create intermediate directories automatically.

Add directory creation to ensure parent directories exist:

   # Cloudflare token configuration
   cloudflareTokenConfig = lib.mkIf (builtins.elem "cloudflare" cfg.services && cfg.cloudflare.tokenPath != null) {
     home.sessionVariables.CLOUDFLARE_TOKEN_FILE = cfg.cloudflare.tokenPath;
-    home.file.".cloudflared/token".source = cfg.cloudflare.tokenPath;
+    home.file.".cloudflared/token" = {
+      source = cfg.cloudflare.tokenPath;
+      recursive = true;
+    };
   };

   # Ngrok config file
   ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.services && cfg.ngrok.configPath != null) {
-    home.file.".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath;
+    home.file.".config/ngrok/ngrok.yml" = {
+      source = cfg.ngrok.configPath;
+      recursive = true;
+    };
   };
modules/system/common/games/games.nix (2)

29-33: Steam compat tools path still uses problematic builtins.getEnv "HOME".

During evaluation, HOME is usually unset, producing an invalid path like /compatibilitytools.d.

The default path needs to be derived differently since builtins.getEnv "HOME" fails during evaluation. Consider removing the default or using a proper user home derivation:

     steam.compatToolsPath = lib.mkOption {
       type = lib.types.path;
-      default = "${builtins.getEnv "HOME"}/.steam/root/compatibilitytools.d";
+      # Remove default or derive from user config
       description = "Path for Steam compatibility tools";
     };

70-72: Environment variable merging issue persists.

STEAM_EXTRA_COMPAT_TOOLS_PATHS should accumulate paths from multiple modules, not overwrite existing values.

Use proper merging for the environment variable:

       environment.sessionVariables = lib.mkIf (lib.elem "steam" cfg.clients) {
-        STEAM_EXTRA_COMPAT_TOOLS_PATHS = cfg.steam.compatToolsPath;
+        STEAM_EXTRA_COMPAT_TOOLS_PATHS = lib.mkMerge [ cfg.steam.compatToolsPath ];
       };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8e59da and 5e3e69f.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • flake.nix (4 hunks)
  • modules/hm/common/browser/default.nix (2 hunks)
  • modules/hm/common/communication/mail/default.nix (1 hunks)
  • modules/hm/common/default.nix (2 hunks)
  • modules/hm/common/dev/global-tools/cli.nix (1 hunks)
  • modules/hm/common/dev/rust.nix (1 hunks)
  • modules/hm/common/documentation/default.nix (1 hunks)
  • modules/hm/common/emulator/default.nix (3 hunks)
  • modules/hm/common/engine/default.nix (1 hunks)
  • modules/hm/common/extra/ignore-file-retriever.nix (3 hunks)
  • modules/hm/common/network/tunnel.nix (3 hunks)
  • modules/system/common/default.nix (2 hunks)
  • modules/system/common/games/games.nix (3 hunks)
  • modules/system/common/networks/wol.nix (1 hunks)
  • modules/system/common/security/antivirus.nix (1 hunks)
  • modules/system/hosts/fern/default.nix (1 hunks)
  • modules/system/hosts/fern/drivers.nix (0 hunks)
  • modules/system/hosts/fern/sunshine.nix (1 hunks)
  • modules/system/hosts/oak/default.nix (1 hunks)
💤 Files with no reviewable changes (1)
  • modules/system/hosts/fern/drivers.nix
🧰 Additional context used
🪛 GitHub Actions: Flake Check
flake.nix

[error] 105-106: Nix flake check failed: The option modules.system.games.steam.enable does not exist. Error triggered during evaluation of nixosConfigurations in flake.nix at line 105.

🔇 Additional comments (41)
flake.nix (8)

28-31: LGTM: nix-darwin input properly configured.

The nix-darwin input follows the same pattern as other inputs and correctly follows nixpkgs to maintain version consistency.


34-34: LGTM: Outputs function properly updated for nix-darwin.

The function signature correctly includes the nix-darwin parameter to use the newly added input.


54-66: LGTM: Well-structured macOS configuration function.

The mkDarwinHost function follows the same pattern as mkHost and properly handles macOS system configuration. The hardcoded system architecture is acceptable with the explanatory comment.


114-117: LGTM: Darwin configurations properly structured.

The darwinConfigurations section correctly uses the new mkDarwinHost function, and the comment provides helpful guidance for customization.


122-122: LGTM: Pine deployment node properly configured.

The pine deployment node follows the established pattern and correctly targets the local variant.


140-141: LGTM: Pine deployment logic properly implemented.

The pine deployment cases are correctly added to both individual and batch deployment logic.

Also applies to: 145-145


159-161: LGTM: Pine deployment checks properly configured.

The pine deployment checks follow the established pattern and are correctly integrated with the deploy-rs framework.


108-108: We need to see if hosts/pine/default.nix actually references any modules.* paths:

#!/bin/bash
grep -R -n "modules\." hosts/pine/default.nix || echo "No module references in pine host config"
modules/hm/common/documentation/default.nix (1)

4-4: Namespace change looks correct

The refactoring from modules.common.documentation to modules.hm.documentation aligns with the broader namespace reorganization across the codebase.

Also applies to: 18-18

modules/system/common/networks/wol.nix (1)

8-8: Namespace reorganization looks correct

The change from modules.fern.wol to modules.system.networks.wol properly groups the Wake-on-LAN module under the system networks hierarchy, consistent with the broader module reorganization.

Also applies to: 11-11

modules/hm/common/default.nix (1)

9-9: Module consolidation and additions look good

The addition of Discord communication module, enabling of ignore-file-retriever, and consolidation of individual game modules into a unified games.nix module improves maintainability and organization.

Also applies to: 33-33, 37-37

modules/system/common/default.nix (1)

19-20: Import path updates align with module consolidation

The simplification of import paths (vpn/tailscale.nixvpn.nix, containers/containers.nixcontainers.nix) and addition of wol.nix properly reflect the module consolidation and namespace reorganization.

Also applies to: 29-29

modules/system/hosts/fern/sunshine.nix (1)

8-8: Namespace change is correct

The refactoring from modules.fern.sunshine to modules.system.fern.sunshine properly aligns with the system namespace reorganization.

Also applies to: 11-11

modules/system/hosts/fern/default.nix (1)

10-30: LGTM: Clean namespace migration improves module organization

The migration from modules to modules.system namespace is well-executed. The restructuring with dedicated networks and fern sections provides better logical grouping of configuration options.

modules/hm/common/browser/default.nix (2)

6-34: Excellent mapping-based refactoring

The introduction of browserToPackage and browserToDriver mappings with dynamic package collection is a clean, maintainable approach. The null filtering and deduplication logic is well-implemented.


39-42: Good: Dynamic enum generation ensures consistency

Using lib.attrNames browserToDriver for the enum type ensures that available options stay in sync with the mapping definition, preventing configuration drift.

modules/hm/common/engine/default.nix (1)

15-21: Inconsistent option path creates scope mismatch

Options are declared under modules.hm but accessed as cfg.engine, creating a mismatch. This should be modules.hm.engine to align with the intended scope.

-options.modules.hm = {
+options.modules.hm.engine = {
   engine = lib.mkOption {

Then update the cfg binding accordingly:

-cfg = config.modules.hm;
+cfg = config.modules.hm.engine;

Likely an incorrect or invalid review comment.

modules/hm/common/extra/ignore-file-retriever.nix (4)

4-4: LGTM: Namespace migration to modules.hm

The configuration namespace has been correctly updated to align with the broader migration from modules.common to modules.hm seen across the codebase.


6-11: Good improvement: Path normalization

The path expansion function now properly normalizes paths by removing trailing slashes before processing, which enhances consistency in path handling.


69-69: Correct use of double single-quote escaping

The string interpolation has been properly updated to use Nix's ''${variable}'' syntax for shell script generation, which correctly handles escaping within the embedded shell script.

Also applies to: 74-74, 77-77


91-91: Consistent options namespace update

The options declaration correctly reflects the new modules.hm.extra.ignore-file-retriever namespace, maintaining consistency with the configuration reference.

modules/hm/common/dev/global-tools/cli.nix (3)

4-4: LGTM: Namespace migration to modules.hm

The configuration namespace has been correctly updated to align with the broader migration pattern across the codebase.


6-14: Excellent refactoring: Clean mapping-based approach

The introduction of cliToPackage mapping and the streamlined package selection logic using lib.filter and map significantly improves maintainability and readability compared to the previous conditional approach.


18-23: Good practice: Dynamic enum generation

Using lib.attrNames cliToPackage for the enum ensures the option definition stays automatically synchronized with the package mapping, preventing drift between allowed values and available packages.

modules/system/hosts/oak/default.nix (3)

7-7: LGTM: Consistent namespace migration

The update to modules.system namespace aligns with the systematic reorganization of system modules across the codebase.


15-17: Good modernization: List-based configuration

The migration from individual boolean flags to list-based configuration (games.clients, networks.vpn, virtualisation.containers.engines) provides better flexibility by supporting multiple simultaneous selections rather than single choices.


25-25: Consistent pattern: Multiple antivirus engines

The change from a single engine to engines list follows the same pattern as other modules, allowing multiple antivirus engines to be enabled simultaneously.

modules/system/common/security/antivirus.nix (3)

4-4: LGTM: Namespace migration to modules.system

The configuration namespace has been correctly updated to align with the system module organization.


17-21: Good improvement: List-based engines configuration

The migration from single engine enum to a list of engines provides better flexibility and aligns with the pattern used across other modules in this refactoring.


24-32: Clean package aggregation and service configuration

The use of lib.concatMap for package aggregation and conditional service enabling based on engine presence is well-structured and maintainable.

modules/hm/common/emulator/default.nix (5)

4-4: LGTM: Namespace migration to modules.hm

The configuration namespace has been correctly updated to align with the broader migration pattern across Home Manager modules.


6-32: Excellent modularization: Structured package mappings

The introduction of emulatorToPackage, winePackages, and protonPackages mappings significantly improves code organization and maintainability. The streamlined package aggregation logic is much cleaner than the previous approach.


38-38: Breaking change: Default emulators list

The default has been changed from ["wine"] to an empty list. This is a breaking change that users should be aware of, though it provides more explicit control over enabled emulators.


51-52: Simplified wine versions: "staging" removed

The wine version enum has been simplified by removing the "staging" option and changing the default to "stable". Ensure this doesn't break existing configurations that might have been using the staging version.


74-74: Good practice: Package deduplication

The use of lib.unique prevents duplicate packages in home.packages, which is a good defensive practice when aggregating packages from multiple sources.

modules/hm/common/network/tunnel.nix (3)

4-11: LGTM! Clean namespace migration and service mapping.

The refactor from modules.common.network.tunnel to modules.hm.network.tunnel aligns with the broader namespace reorganization. The servicesToPackage mapping provides a clean, data-driven approach for package selection.


49-53: Well-designed dynamic enum type definition.

The use of lib.attrNames servicesToPackage for the enum type ensures the option stays in sync with available services automatically. This is a best practice for maintainability.


90-99: Clean configuration merge pattern.

The use of lib.mkMerge with separate conditional configurations provides a clean separation of concerns and makes the module logic easy to follow.

modules/system/common/games/games.nix (3)

6-16: Excellent refactor to data-driven client selection.

The clientToPackage mapping and dynamic package aggregation significantly improves maintainability compared to individual boolean flags. The pattern is consistent with other modules in this PR.


87-102: Well-structured conditional Steam configuration.

The conditional enabling of Steam-related programs based on client list membership is clean and follows NixOS best practices. The separation of gamescope and steam program configurations is logical.


69-73: Environment variable should use lib.unique for packages.

Following the same pattern as the tunnel module, clientPackages should be deduplicated to prevent issues with duplicate package paths.

Apply this diff:

-      environment.systemPackages = lib.unique clientPackages;
+      environment.systemPackages = lib.unique clientPackages;

Wait, the code already has lib.unique. The Steam environment variable configuration looks correct.

Likely an incorrect or invalid review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (6)
flake.nix (1)

147-147: LGTM: Usage message correctly updated.

The usage message now includes all valid options including the new pine host.

hosts/pine/default.nix (1)

78-78: Remove commented initialPassword line for security.

The commented initial password line should be removed entirely to prevent accidental uncommenting in production.

-    #initialPassword = "${vars.user}";
+    # WARNING: Never set initialPassword in production configurations
modules/hm/common/dev/editor/jetbrains.nix (1)

4-7: Add backward compatibility alias for the old namespace.

The namespace migration from modules.common.dev.editor.jetbrains to modules.hm.dev.editor.jetbrains lacks a compatibility alias, which could break existing user configurations.

modules/hm/common/games/games.nix (1)

20-21: Fix invalid attribute names with hyphens.

The bare identifiers rocket-league and star-citizen contain hyphens, which are invalid in Nix and will cause evaluation failures. These must be quoted as strings.

Also applies to: 24-25

modules/system/common/games/games.nix (2)

31-31: Default Steam compat-tools path uses unreliable environment variable.

The use of builtins.getEnv "HOME" during evaluation is problematic since HOME is typically unset, resulting in an invalid path like /compatibilitytools.d.

Consider deriving from the target user's home directory or removing the default:

- default = "${builtins.getEnv "HOME"}/.steam/root/compatibilitytools.d";
+ # Remove default and require explicit configuration
+ # default = "${config.users.users.${config.mainUser}.home}/.steam/root/compatibilitytools.d";

71-71: Environment variable overwrites instead of accumulating paths.

STEAM_EXTRA_COMPAT_TOOLS_PATHS should accumulate paths from multiple modules rather than overwriting existing values.

- STEAM_EXTRA_COMPAT_TOOLS_PATHS = cfg.steam.compatToolsPath;
+ STEAM_EXTRA_COMPAT_TOOLS_PATHS = lib.mkMerge [ 
+   (lib.mkDefault "")
+   cfg.steam.compatToolsPath 
+ ];

Or use colon-separated concatenation if multiple paths need to be supported.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e3e69f and d02c122.

📒 Files selected for processing (14)
  • flake.nix (4 hunks)
  • hosts/oak/default.nix (1 hunks)
  • hosts/pine/default.nix (1 hunks)
  • modules/hm/common/communication/discord.nix (1 hunks)
  • modules/hm/common/communication/mail/default.nix (1 hunks)
  • modules/hm/common/default.nix (2 hunks)
  • modules/hm/common/dev/editor/jetbrains.nix (2 hunks)
  • modules/hm/common/documentation/default.nix (1 hunks)
  • modules/hm/common/games/games.nix (1 hunks)
  • modules/hm/common/network/tunnel.nix (3 hunks)
  • modules/system/common/games/games.nix (3 hunks)
  • modules/system/common/hardware/powersave.nix (2 hunks)
  • modules/system/common/security/antivirus.nix (1 hunks)
  • modules/system/common/security/password-manager.nix (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Flake Check
flake.nix

[error] 105-106: Nix flake check failed due to invalid option 'modules.system.games.steam.enable' which does not exist. Error triggered in nixosConfigurations.fern configuration.

🔇 Additional comments (36)
flake.nix (5)

28-31: LGTM: Clean addition of nix-darwin input.

The nix-darwin input is properly configured with nixpkgs following to maintain consistency.


54-66: LGTM: Well-structured macOS host configuration function.

The mkDarwinHost function follows the same pattern as mkHost and correctly uses darwinSystem for macOS configurations. The system architecture and module path are appropriate.


108-108: LGTM: Consistent integration of pine host.

The pine host is properly integrated following the established patterns for fern and oak hosts, including both local and non-local variants plus deployment configuration.

Also applies to: 111-111, 122-122


114-117: Consider adding documentation for macOS hostname discovery.

The comment provides helpful guidance about finding the actual hostname. This is good practice for macOS configurations.


105-106: Investigate pipeline failure related to module structure changes.

The pipeline is failing due to an invalid option modules.system.games.steam.enable in the fern configuration. This suggests the module namespace reorganization from modules.common to modules.system mentioned in the PR objectives may have introduced inconsistencies.

Verify that all module references have been consistently updated across the codebase:

#!/bin/bash
# Search for old module namespace references that may not have been updated
echo "Searching for old module namespace references..."
rg -n "modules\.common" --type nix

echo "Searching for steam configuration references..."
rg -n "games\.steam" --type nix

echo "Checking fern host configuration specifically..."
cat hosts/fern/default.nix 2>/dev/null || echo "hosts/fern/default.nix not found"
hosts/pine/default.nix (5)

7-21: LGTM: Well-structured package configuration with proper overlays.

The nixpkgs configuration properly uses hydenix inputs with overlays and creates a userPkgs overlay for additional packages. The allowUnfree settings are consistently applied.


42-43: LGTM: Appropriate hardware module selection.

Using common-pc and common-pc-ssd modules from nixos-hardware is a good choice for general PC hardware support.


46-46: Good hardware-specific configuration.

The HDMI kernel parameter is appropriate for ensuring proper video output on this specific hardware.


69-74: LGTM: Proper hydenix configuration for French locale.

The configuration correctly sets up the hydenix desktop environment with French locale and Paris timezone.


79-86: LGTM: Standard user group configuration.

The user groups include all necessary permissions for a desktop user (wheel, networkmanager, video, lp, scanner).

modules/hm/common/documentation/default.nix (1)

1-29: LGTM! Clean refactoring with improved maintainability.

The namespace migration and dynamic mapping approach are well-implemented. Past review concerns about duplicate packages and safe attribute access have been properly addressed with lib.unique and the or null pattern.

modules/system/common/hardware/powersave.nix (1)

107-123: Battery threshold settings now properly conditional.

The charge threshold configuration correctly uses lib.optionalString cfg.batteryHealth.enable to conditionally apply settings, addressing the previous concern about unconditional application. The dual battery support (BAT0/BAT1) and threshold persistence settings are well-implemented.

modules/system/common/security/password-manager.nix (1)

1-58: Well-structured refactoring with improved modularity.

The namespace migration and dynamic mapping implementation are excellent. The use of lib.unique properly addresses the previous concern about package duplicates between password manager and YubiKey packages. The modular config structure with lib.mkMerge enhances readability.

modules/hm/common/network/tunnel.nix (1)

98-98: Good use of lib.unique for package deduplication.

The implementation properly addresses the previous concern about duplicate packages by using lib.unique.

modules/hm/common/default.nix (3)

9-9: Good addition of Discord communication module.

Adding Discord support enhances the communication tools available in the configuration.


33-33: Enabling ignore-file-retriever functionality.

Uncommenting this import enables useful file retrieval functionality that was previously disabled.


35-37: Excellent games module consolidation.

Replacing individual game imports with a unified games.nix improves maintainability and reduces import complexity. The addition of joystick.nix provides complementary gaming hardware support.

hosts/oak/default.nix (1)

18-21: Good structural consistency improvement!

The configuration is now consistent with the outer pkgs import structure, grouping options under a config attribute. This improves maintainability and readability.

modules/hm/common/dev/editor/jetbrains.nix (1)

18-24: Good deduplication implementation!

The use of lib.unique properly handles duplicate IDE entries in the configuration list, preventing redundant package installations.

modules/hm/common/games/games.nix (2)

34-34: Excellent deduplication implementation!

The use of lib.unique prevents duplicate packages when the same game appears multiple times in cfg.enabledGames.


1-48: Well-structured consolidation of game modules.

This unified approach to game configuration is much cleaner than having separate modules for each game. The data-driven mapping with dynamic enumerations improves maintainability.

modules/hm/common/communication/mail/default.nix (3)

4-4: Consistent namespace migration!

The namespace change from modules.common.communication.mail to modules.hm.communication.mail aligns with the broader refactoring across the repository.

Also applies to: 18-18


9-15: Excellent dynamic mapping and deduplication implementation!

The service-to-package mapping with list support and lib.unique deduplication properly handles shared packages between services, preventing duplicates in the final package list.


20-20: Good use of dynamic enumeration!

Using lib.attrNames serviceToPackage for the enum type ensures the option validation stays in sync with available services automatically.

modules/hm/common/communication/discord.nix (3)

49-49: Good default value choice for RPC!

Setting rpc.enable = false by default prevents automatic inclusion of discord-rpc when users don't explicitly need it.


54-54: Correct conditional logic implementation!

The condition properly includes all three cases: clients, overlays, and RPC enable, ensuring packages are installed when any feature is requested.


6-31: Well-structured package mappings!

The separation of clients, overlays, and RPC into distinct mappings with proper list handling creates a clean and maintainable configuration structure.

modules/system/common/security/antivirus.nix (5)

4-4: LGTM: Namespace migration aligns with PR objectives.

The change from modules.security.antivirus to modules.system.security.antivirus follows the systematic namespace reorganization described in the PR objectives.


6-10: LGTM: Well-structured engine-to-package mapping.

The engineToPackages mapping cleanly associates engine names with their packages, and the conditional GUI package inclusion for ClamAV is properly implemented. This addresses the previous early evaluation concerns since cfg.gui.enable is accessed after options are defined.


12-14: LGTM: Efficient package aggregation.

The use of lib.concatMap to flatten and collect packages from selected engines is clean and efficient.


19-23: LGTM: List-based approach improves flexibility.

The change from a single engine enum to an engines list allows multiple antivirus engines to be enabled simultaneously. The removal of "none" from the enum and defaulting to an empty list addresses the previous UX concerns about silent filtering.


29-29: LGTM: Correct service condition logic.

Using lib.elem "clamav" enabledEngines properly checks if ClamAV packages are included, ensuring the service is only enabled when the engine is actually selected.

modules/system/common/games/games.nix (4)

4-4: LGTM: Namespace migration aligns with PR objectives.

The change from modules.games to modules.system.games follows the systematic namespace reorganization described in the PR objectives.


6-12: LGTM: Clean client-to-package mapping.

The clientToPackage mapping provides a clear association between client names and their packages, supporting the new list-based approach effectively.


19-26: LGTM: Unified client selection improves maintainability.

The change from individual boolean enable flags to a unified clients list option enhances flexibility and follows the consistent pattern described in the PR objectives. The description correctly includes all supported clients including "nexus".


87-101: LGTM: Conditional program configuration based on client selection.

The Steam-specific program configuration is properly conditional on "steam" being in the clients list, maintaining clean separation of concerns.

@ClementBobin ClementBobin merged commit d5f892d into main Jun 25, 2025
2 of 3 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@coderabbitai coderabbitai bot mentioned this pull request Sep 1, 2025
Merged
7 tasks
@coderabbitai coderabbitai bot mentioned this pull request Nov 13, 2025
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants