about summary refs log tree commit diff
path: root/users/Profpatsch/netencode/gen.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/netencode/gen.nix')
-rw-r--r--users/Profpatsch/netencode/gen.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/users/Profpatsch/netencode/gen.nix b/users/Profpatsch/netencode/gen.nix
index 2d2456efeaa5..305ff7b08dd6 100644
--- a/users/Profpatsch/netencode/gen.nix
+++ b/users/Profpatsch/netencode/gen.nix
@@ -36,11 +36,15 @@ let
       "bool" = n1;
       "int" = i6;
       "string" = text;
-      "set" = attrs: record (lib.mapAttrsToList
-        (k: v: {
-          key = k;
-          val = dwim v;
-        }) attrs);
+      "set" = attrs:
+        # it could be a derivation, then just return the path
+        if attrs.type or "" == "derivation" then text "${attrs}"
+        else
+          record (lib.mapAttrsToList
+          (k: v: {
+            key = k;
+            val = dwim v;
+          }) attrs);
       "list" = l: list (map dwim l);
     };
     in match.${builtins.typeOf val} val;