mob next [ci-skip] [ci skip] [skip ci]

lastFile:modules/clan/phonebox/default.nix
This commit is contained in:
2025-12-01 16:31:02 +07:00
parent 0304c37c72
commit e7e12d0df2
2 changed files with 0 additions and 30 deletions

View File

@@ -1,29 +0,0 @@
nwid:
{ pkgs, ... }:
let
ztInterfaceScript = pkgs.writeShellScript "zt-interface" ''
#!/usr/bin/env bash
network="$1"
index=${"2:-0"}
network="0x$network"
# zerotier hash function
network=$(( (($network ^ ($network >> (3*8))) + $index ) % (1<<(5*8)) ))
# encode the result in base32
while [ $network -gt 0 ]; do
index=$(( $network % (1<<5) + 24 ))
[ $index -lt 50 ] && index=$(( $index + 73 ))
result="$(printf "\\%03o" $index)$result"
network=$(( $network >> 5 ))
done
echo "zt$(printf %b "$result")"
'';
result = pkgs.runCommand "zt-interface-output" { } ''
${ztInterfaceScript} > $out
'';
in
builtins.readFile result

View File

@@ -25,7 +25,6 @@
{
lib,
config,
pkgs,
...
}:
let