From 8c190c3f7d49be0469645157297bb2f0773e8f87 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 5 Nov 2017 22:47:09 +0200 Subject: [PATCH] lib/types.nix: Disable 32-bit integer types for now This file doesn't evaluate in 32-bit versions of Nix because the integer type is a signed 32-bit integer there, so 4294967296 causes an 'invalid integer' error. I see no other way around than commenting this out :( (s32 could be made to work by tweaking the expressions a bit, but didn't do that for now since it'd be asymmetric to have s32 but no u32). --- lib/types.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index adbae8f08a5413..46ed05d288f2e3 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -157,14 +157,14 @@ rec { }; u8 = unsign 8 256; u16 = unsign 16 65536; - u32 = unsign 32 4294967296; - # the biggest int the nix lexer accepts is 9223372036854775808 - # the smallest int the nix lexer accepts is -9223372036854775807 - # unsigned64 = unsign 64 18446744073709551616; + # the biggest int a 64-bit Nix accepts is 2^63 - 1 (9223372036854775808), for a 32-bit Nix it is 2^31 - 1 (2147483647) + # the smallest int a 64-bit Nix accepts is -2^63 (-9223372036854775807), for a 32-bit Nix it is -2^31 (-2147483648) + # u32 = unsign 32 4294967296; + # u64 = unsign 64 18446744073709551616; s8 = sign 8 256; s16 = sign 16 65536; - s32 = sign 32 4294967296; + # s32 = sign 32 4294967296; }; str = mkOptionType {