From 7de0c651b7f50d66138f405c883ebc66aef6b9db Mon Sep 17 00:00:00 2001
From: DavHau <hsngrmpf+github@gmail.com>
Date: Sun, 10 Dec 2023 20:07:51 +0700
Subject: [PATCH] raise error when flake attribute doesn't exist

Currently when trying to access packages from input flakes for a system that isn't supported by that flake, the error is not very conclusive.
It costed me at least an hour to grasp this. Now putting in this error message to prevent others from falling into the same trap.
---
 modules/transposition.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/transposition.nix b/modules/transposition.nix
index 7e985ba..94470c6 100644
--- a/modules/transposition.nix
+++ b/modules/transposition.nix
@@ -67,7 +67,11 @@ in
     perInput =
       system: flake:
       mapAttrs
-        (attrName: attrConfig: flake.${attrName}.${system})
+        (attrName: attrConfig:
+          flake.${attrName}.${system} or (throw ''
+            Attemt to access non existent attribute ${attrName}.${system} of flake ${flake}.
+          '')
+        )
         config.transposition;
 
     perSystem = {