mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
Use isType instead of typeOf
This commit is contained in:
parent
4b1a9dd00b
commit
cfab329437
2 changed files with 2 additions and 3 deletions
|
@ -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]
|
&& elem x.bits [8 16 32 64 128]
|
||||||
&& (builtins.lessThan 8 x.bits -> isSignificantByte x.significantByte);
|
&& (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
|
&& isCpuType x.cpu
|
||||||
&& isArchitecture x.arch
|
&& isArchitecture x.arch
|
||||||
&& isKernel x.kernel;
|
&& isKernel x.kernel;
|
||||||
|
|
|
@ -12,7 +12,6 @@ with lib.modules;
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
isType = type: x: (x._type or "") == type;
|
isType = type: x: (x._type or "") == type;
|
||||||
hasType = x: isAttrs x && x ? _type;
|
|
||||||
typeOf = x: x._type or "";
|
typeOf = x: x._type or "";
|
||||||
|
|
||||||
setType = typeName: value: value // {
|
setType = typeName: value: value // {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue