From 08ec11ae1b57564fd15140805303c5bb00343877 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Wed, 13 Nov 2024 00:08:21 +0100 Subject: [PATCH] lib: Fix jsonTypes evaluation This will be very useful for generating documentation and python type definitions. --- src/disko_lib/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/disko_lib/default.nix b/src/disko_lib/default.nix index 70653cf..c7659b8 100644 --- a/src/disko_lib/default.nix +++ b/src/disko_lib/default.nix @@ -25,7 +25,7 @@ let _partitionTypes = { inherit (diskoLib.types) btrfs filesystem zfs mdraid luks lvm_pv swap; }; partitionType = extraArgs: lib.mkOption { type = lib.types.nullOr (diskoLib.subType { - types = diskoLib.partitionTypes; + types = diskoLib._partitionTypes; inherit extraArgs; }); default = null; @@ -36,7 +36,7 @@ let _deviceTypes = { inherit (diskoLib.types) table gpt btrfs filesystem zfs mdraid luks lvm_pv swap; }; deviceType = extraArgs: lib.mkOption { type = lib.types.nullOr (diskoLib.subType { - types = diskoLib.deviceTypes; + types = diskoLib._deviceTypes; inherit extraArgs; }); default = null; @@ -666,9 +666,9 @@ let }; diskoLib = { optionTypes.absolute-pathname = "absolute-pathname"; - # Spoof these tyeps - deviceType = _: ""; - partitionType = _: ""; + # Spoof these types to avoid infinite recursion + deviceType = _: "deviceType"; + partitionType = _: "partitionType"; subType = { types, ... }: { type = "oneOf"; types = lib.attrNames types;