diff --git a/lib/systems.nix b/lib/systems.nix index 1ef869fb012..afa2002c6e4 100644 --- a/lib/systems.nix +++ b/lib/systems.nix @@ -22,7 +22,7 @@ rec { }; - isCpuType = x: typeOf x == "cpu-type" + isCpuType = x: isType "cpu-type" x && elem x.bits [8 16 32 64 128] && (builtins.lessThan 8 x.bits -> isSignificantByte x.significantByte); @@ -69,7 +69,7 @@ rec { }; - isSystem = x: typeOf x == "system" + isSystem = x: isType "system" x && isCpuType x.cpu && isArchitecture x.arch && isKernel x.kernel; diff --git a/lib/types.nix b/lib/types.nix index 0545cd6a3c2..aa8a371d953 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -12,7 +12,6 @@ with lib.modules; rec { isType = type: x: (x._type or "") == type; - hasType = x: isAttrs x && x ? _type; typeOf = x: x._type or ""; setType = typeName: value: value // {