I can’t seem to find a quick way to create a list like [0 1 2 3 4 5] from just the start and end integers, equivalent to Bash’s {0..5} (inclusive) or Python’s list(range(6)) (exclusive). (I got a bit of a shock when it turned out [1..5] evaluated to [1 0.5], despite there being no spaces between the dots!)
Found it:
> builtins.genList (x: x) 6
[
0
1
2
3
4
5
]
1 Like
Take a look at lib.range.
1 Like
Thank you, done!
For posterity - I find searching through https://noogle.dev very helpful in these scenarios. Here’s lib.range: lib.range - Nix function reference
3 Likes