nixos-config/subprojects/bahaghari/lib/hex.nix
Gabriel Arazas fdc8476751
bahaghari: init lib
Now it is pretty familiar to use as you can also extend it like nixpkgs'
library.
2024-02-23 14:57:33 +08:00

12 lines
393 B
Nix

# A small utility library for manipulating hexadecimal numbers. It's made in 15
# minutes with a bunch of duct tape on it but it's working for its intended
# purpose.
{ pkgs, lib }:
rec {
inherit (pkgs.lib.trivial) toHexString;
# A variant of `lib.lists.range` function just with hexadecimal digits.
range = first: last: builtins.map (n: toHexString n) (lib.lists.range first last);
}