Skip to content

Commit

Permalink
lib/types.nix: Disable 32-bit integer types for now
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
dezgeg committed Nov 5, 2017
1 parent 68d4912 commit 8c190c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/types.nix
Expand Up @@ -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 {
Expand Down

0 comments on commit 8c190c3

Please sign in to comment.