format tree
This commit is contained in:
parent
24547fcd6c
commit
92c55595d0
43 changed files with 476 additions and 357 deletions
users
|
@ -1,11 +1,17 @@
|
|||
{ lib }:
|
||||
let
|
||||
chrs = lib.listToAttrs (lib.imap (i: v: { name = v; value = i + 96; }) lib.lowerChars);
|
||||
chrs = lib.listToAttrs (
|
||||
lib.imap (i: v: {
|
||||
name = v;
|
||||
value = i + 96;
|
||||
}) lib.lowerChars
|
||||
);
|
||||
ord = c: builtins.getAttr c chrs;
|
||||
in
|
||||
{
|
||||
# Make a unique UID from a 4-char identifier
|
||||
mkUid = id:
|
||||
mkUid =
|
||||
id:
|
||||
let
|
||||
chars = lib.stringToCharacters (builtins.substring 0 4 id);
|
||||
n = builtins.map (c: lib.mod (ord c) 10) chars;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue