summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2017-11-05 22:47:09 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-11-05 22:47:09 +0200
commit8c190c3f7d49be0469645157297bb2f0773e8f87 (patch)
treef5abe2a89c727f69af0a0709f5bd1b104beba2b1 /lib/types.nix
parent68d4912ea55c0568f2d5f18da3c30e86a0b67b6f (diff)
downloadnixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar.gz
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar.bz2
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar.lz
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar.xz
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.tar.zst
nixlib-8c190c3f7d49be0469645157297bb2f0773e8f87.zip
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).
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/types.nix b/lib/types.nix
index adbae8f08a54..46ed05d288f2 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 {