From 21ac911b1d0a92b60d4a2b957ed78670872e436f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jan 2025 06:48:17 +0100 Subject: [PATCH] Add custom merge error for unknown flake output attrs --- modules/flake.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/flake.nix b/modules/flake.nix index 012a6c9..7792529 100644 --- a/modules/flake.nix +++ b/modules/flake.nix @@ -10,7 +10,23 @@ in flake = mkOption { type = types.submoduleWith { modules = [ - { freeformType = types.lazyAttrsOf types.raw; } + { + freeformType = + types.lazyAttrsOf + (types.unique + { + message = '' + No option has been declared for this flake output attribute, so its definitions can't be merged automatically. + Possible solutions: + - Load a module that defines this flake output attribute + Many modules are listed at https://flake.parts + - Declare an option for this flake output attribute + - Make sure the output attribute is spelled correctly + - Define the value only once, with a single definition in a single module + ''; + } + types.raw); + } ]; }; description = ''