oizys/lib/extended.nix

22 lines
705 B
Nix
Raw Normal View History

2024-02-27 10:41:27 -06:00
final: prev: let
2024-03-01 00:26:52 -06:00
inherit (final) hasSuffix;
2024-02-27 10:41:27 -06:00
runes = import ../modules/runes;
2024-03-19 08:54:11 -05:00
in rec {
2024-03-19 07:24:30 -05:00
enabled = {enable = true;};
disabled = {enable = false;};
2024-03-19 08:54:11 -05:00
# ["a" "b"] -> {a.enable = true; b.enable = true;}
enableAttrs = attrs: builtins.listToAttrs (map (attr: {name = attr; value = enabled; }) attrs);
# ["a" "b"] -> {a.enable = false; b.enable = false;}
disableAttrs = attrs: builtins.listToAttrs (map (attr: {name = attr; value = disabled; }) attrs);
2024-03-01 00:26:52 -06:00
isNixFile = path: hasSuffix ".nix" path;
2024-02-27 10:41:27 -06:00
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
mkRune = {
rune,
number ? "6",
runeKind ? "braille",
}:
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n";
}