Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd \
--exclude doc/manual/release-notes \
--type file \
. \
nixos \
--exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
46 lines
975 B
Nix
46 lines
975 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
mainPort = 9445;
|
|
webPort = 9446;
|
|
in
|
|
{
|
|
name = "meshtasticd";
|
|
meta.maintainers = [ lib.maintainers.drupol ];
|
|
|
|
nodes.machine = {
|
|
services.meshtasticd = {
|
|
enable = true;
|
|
port = mainPort;
|
|
|
|
settings = {
|
|
Lora = {
|
|
Module = "sim";
|
|
DIO2_AS_RF_SWITCH = false;
|
|
spiSpeed = "2000000";
|
|
};
|
|
Webserver = {
|
|
Port = webPort;
|
|
RootPath = pkgs.meshtastic-web;
|
|
};
|
|
General = {
|
|
MaxNodes = 200;
|
|
MaxMessageQueue = 100;
|
|
MACAddressSource = "eth0";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
with subtest("Test meshtasticd service"):
|
|
machine.wait_for_unit("meshtasticd.service")
|
|
machine.wait_for_open_port(${toString mainPort})
|
|
machine.wait_for_open_port(${toString webPort})
|
|
machine.succeed("curl -fvvv -Ls http://localhost:${toString webPort} | grep -q 'Meshtastic Web Client'")
|
|
'';
|
|
}
|