From cbdeb079d1327610149b067a65db6bc6b874fa4c Mon Sep 17 00:00:00 2001
From: Robert Hensing <robert@roberthensing.nl>
Date: Wed, 5 Jun 2024 13:16:21 +0200
Subject: [PATCH] nix flake check: Allow modules attribute

This is intended as a module system "library" in the format

<flake>.modules.<class>.<name>

where class is e.g. "nixos" or "homeManager", and the name
is of the author's choice.

Modules that can be loaded in any module system application should
use the name "generic".

- Implemented in the module system in https://github.com/NixOS/nixpkgs/pull/197547

- Class parameter for checking: https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class
---
 src/nix/flake.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index fb7ea6211..2bf3de1b3 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -773,6 +773,7 @@ struct CmdFlakeCheck : FlakeCommand
                             || name == "homeConfigurations"
                             || name == "homeModule"
                             || name == "homeModules"
+                            || name == "modules"
                             || name == "nixopsConfigurations"
                             )
                             // Known but unchecked community attribute