Commit Graph
100 Commits
Author SHA1 Message Date
Daniel Barlow 0f31afee2b hellonet: set password for root
otherwise incoming ssh gets a bit fraught
2023-09-17 17:03:56 +01:00
Daniel Barlow 98c63e7498 hellonet: don't run ntp
it's a bit pointless when there's no connectivity to
any ntp server
2023-09-17 17:03:56 +01:00
Daniel Barlow c6faf88dd1 doc WIP: build "hello net" example 2023-09-17 17:03:56 +01:00
Daniel Barlow 35c7f1643f change defaultOutput for hardware devices to flashimage
if you're using tftpboot you probably know what you're doing
2023-09-17 17:00:45 +01:00
Daniel Barlow 70fb9f86d3 mt300a vlan interface services depend on primary 2023-09-17 17:00:38 +01:00
Daniel Barlow b36272f99e add outputs for vlan service 2023-09-17 17:00:31 +01:00
Daniel Barlow 0abe4f96a7 ssh ensure we create /run/dropbear
this is required if we don't have persistent store (jffs2)
2023-09-17 17:00:26 +01:00
Daniel Barlow f7b30939b5 remove service-state when service exits 2023-09-13 22:49:00 +01:00
Daniel Barlow 4fd1b5f08b er, "input" != output" 2023-09-13 18:01:50 +01:00
Daniel Barlow 106a429b3d odhcp-script only write addresses if there are any 2023-09-13 17:51:07 +01:00
Daniel Barlow b3e505abf4 anoia.system print command if it failed 2023-09-13 17:50:40 +01:00
Daniel Barlow 92e107d77c update acquire-delegated-prefix to use svc.events 2023-09-13 17:49:57 +01:00
Daniel Barlow fa040a194c acquire-wan-address remove boundness checking
if we're unbound then the script will be called with
empty ADDRESSES and so the usual case will handle this fine
by removing all the previosuly set addresses
2023-09-13 13:17:58 +01:00
Daniel Barlow 3bdb7754d3 replace var/each with accumulate 2023-09-12 20:55:08 +01:00
Daniel Barlow 8f97c5bf3c anoia service :events method behaves as iterator 2023-09-12 20:46:52 +01:00
Daniel Barlow 7904c6bfe9 anoia users now need lfs
... and we need to figure out how to do transitive
dependencies, because this is not a great experience
2023-09-12 18:46:04 +01:00
Daniel Barlow 74b8c98aaf kludge fix openssl build 2023-09-12 18:44:43 +01:00
Daniel Barlow 0a737c62cd convert acquire-wan-address to writeFennel
this means we can get rid of the inelegant environent variable
check at the bottom of the file
2023-09-12 17:51:00 +01:00
Daniel Barlow 343d3b6508 writeFennel is writeFennelScript with knobs on
The second parameter is now an options attrset, wherein we will pile
all kinds of cool stuff.

Right now the only cool bit is `mainFunction`, which allows you to
compile a fennel module into a lua script and name the function that
should be executed when the script runs. This makes it easier to
write testable Fennel code, because the test script can require the
module and call stuff in it.
2023-09-12 17:45:18 +01:00
Daniel Barlow 96e19767e9 odhcpc-script don't require fennel at runtime 2023-09-12 17:39:06 +01:00
Daniel Barlow 6f2389dd75 la la la 2023-09-12 17:38:18 +01:00
Daniel Barlow d49cbbb8ed test for acquire-wan-address 2023-09-11 00:07:49 +01:00
Daniel Barlow 7683ed69de acquire-wan-address uses parsed addresses from odhcp 2023-09-11 00:07:11 +01:00
Daniel Barlow 3ff55d3aad odhcp-script: unique subdirectory names for each parsed address 2023-09-10 12:15:34 +01:00
Daniel Barlow 22275f311c anoia: add simple hash function and base64 encoder 2023-09-10 12:14:39 +01:00
Daniel Barlow 870da62a1e anoia.svc outputs may be directories (read as table) 2023-09-09 00:30:02 +01:00
Daniel Barlow 0312f7a999 fennelrepl look for .fnl before .lua
this means fennelrepl in nix-shell will prefer local
source files to generated lua files, making it easier
to change library code without restarting the shell
2023-09-09 00:11:35 +01:00
Daniel Barlow 9dd3cf23b4 anoia.fs.mktree replaces mkdir
This uses lfs to make the tree in-process instead of
shelling out to the mkdir command
2023-09-08 21:17:42 +01:00
Daniel Barlow 4e9227dff3 move rmtree to anoia library 2023-09-08 21:03:18 +01:00
Daniel Barlow eaa45906ff fennelrepl runs with --correlate
this is so that error message line numbers match up
2023-09-08 21:02:26 +01:00
Daniel Barlow 7fc5d2934d set FENNEL_PATH using absolute paths 2023-09-08 21:01:39 +01:00
Daniel Barlow 12e25722fa odhcp-script: delete stale dirs from previous runs
This requires adding LFS as a dependency because native Lua has
no way to iterate a directory, but it seems to be Not Huge and
hopefully we'll have other uses for it
2023-09-08 20:48:01 +01:00
Daniel Barlow 09fe21260e rename fn 2023-09-08 20:48:01 +01:00
Daniel Barlow 4bd3ccc8fd inline write-{addresses,prefixes} 2023-09-08 20:48:01 +01:00
Daniel Barlow 3e163d4253 remove unused fn 2023-09-08 20:47:55 +01:00
Daniel Barlow 9487cb2567 DRY near-duplicate code between parse-{addresses,prefixces} 2023-09-08 20:47:55 +01:00
Daniel Barlow 907a9de773 update 2023-09-08 20:47:55 +01:00
Daniel Barlow b25103be2e test script for odhcp6-script 2023-09-08 20:47:55 +01:00
Daniel Barlow 353a199ab2 odhcpc script: parse ADDRESSES and PREFIXES
so downstream doesn't have to
2023-09-05 22:42:25 +01:00
Daniel Barlow 91e957ced7 static leases for rotuer 2023-09-04 23:07:13 +01:00
Daniel Barlow 899f096346 dnsmasq static hosts defaults to empty attrset 2023-09-04 23:02:17 +01:00
Daniel Barlow 0cf4733327 add placeholders for missing module docs 2023-09-04 22:19:22 +01:00
Daniel Barlow 0a6af46364 support dhcp static leases 2023-09-04 22:08:07 +01:00
Daniel Barlow a24c2a23a0 whitespace 2023-09-04 22:06:15 +01:00
Daniel Barlow 9e52faa0b6 remove unused imports 2023-09-04 22:05:42 +01:00
Daniel Barlow 3bdc986dd7 extract "mount filesystem" to module 2023-09-04 21:17:52 +01:00
Daniel Barlow 83092b7b73 add watchdog service 2023-09-02 17:28:40 +01:00
Daniel Barlow 6805e0090d working down the TODOs 2023-09-01 17:57:22 +01:00
Daniel Barlow 3b9c5635b8 update pppoe and wlan tests 2023-09-01 17:55:08 +01:00
Daniel Barlow d3dc9752f8 swap qemu network interfaces around
lan and wan were backwards, it looks like
2023-09-01 17:54:15 +01:00
Daniel Barlow 7ad848cb77 add service to enable packet forwarding
might be worth looking into adding RA config to this
2023-09-01 17:34:47 +01:00
Daniel Barlow ef666c34cd use ssh service in examples 2023-09-01 17:32:53 +01:00
Daniel Barlow d7336679c4 arhcive use ssh service instead of hand-rolling 2023-08-31 23:59:48 +01:00
Daniel Barlow 66ccea1487 update todo 2023-08-31 23:59:33 +01:00
Daniel Barlow 535eb70bb9 convert all route defns to module-based-service 2023-08-31 23:52:59 +01:00
Daniel Barlow 51ad051443 delete unneeded services.default 2023-08-31 23:52:03 +01:00
Daniel Barlow 92970e8ed0 qemu: use service-based-module for network interfaces 2023-08-31 23:50:42 +01:00
Daniel Barlow e04ec2e959 move SWCONFIG defn into per-device files
it doesn't work on qemu
2023-08-31 23:50:07 +01:00
Daniel Barlow d60aab728d reinstate loopback network (oops) 2023-08-31 23:29:30 +01:00
Daniel Barlow 3609d8d5ee implement route as module-based-service 2023-08-31 23:24:23 +01:00
Daniel Barlow 44c1fb7632 delete now-unused (pkgs.liminix.network) interface address 2023-08-31 18:30:22 +01:00
Daniel Barlow e577caa15f extneder: use bridge module 2023-08-31 18:29:45 +01:00
Daniel Barlow 7faf620c0b move loopback config from base to netowrk module 2023-08-31 18:28:35 +01:00
Daniel Barlow b094220466 mt300a: use module-based network services for lan/wan 2023-08-31 18:27:07 +01:00
Daniel Barlow f1dfb1f976 BRIDGE_VLAN_FILTERING depends on bridge _and_ vlan
I'm half-pleased with this. It demonstrates how we can have complex
conditional kernel config, but the way we detect if vlan exists is
tacky.
2023-08-31 18:24:09 +01:00
Daniel Barlow 333327be75 make a module for vlan
Acked-by: Daniel Barlow <<dan@telent.net>>
2023-08-30 23:26:44 +01:00
Daniel Barlow efa1919e04 move squashfs kernel options into module 2023-08-30 22:59:28 +01:00
Daniel Barlow de77635490 move bridge-related kernel config to the module 2023-08-30 17:29:42 +01:00
Daniel Barlow aecbe08f08 add o+x permission on service-state directories
this is needed for resolvconf, which writes resolv.conf as
an output and wants to make it world-readable
2023-08-28 22:02:28 +01:00
Daniel Barlow ff2d3e1a63 TODO comments 2023-08-28 22:02:28 +01:00
Daniel Barlow 8688d47c65 rotuer: create resolv.conf 2023-08-28 22:02:28 +01:00
Daniel Barlow e86daf9bbc default value for services.default
as a default default target, start all the services
2023-08-28 22:02:28 +01:00
Daniel Barlow 23ccfec5fb update examples so they build again 2023-08-28 22:02:28 +01:00
Daniel Barlow 00c8ea66ea add service fir dhcp v4 client 2023-08-28 22:02:28 +01:00
Daniel Barlow 31f0213b6f convert network link/address to module-based-service
... and make bridge use it.

We also had to convert bridge back into a pair of services.
Downstreams want to depend on the bridge it self being configured
even if not necessarily all the members are up. e.g. don't want
to break ssh on lan if there's a misconfigured wlan device
2023-08-28 22:02:28 +01:00
Daniel Barlow 1580857fde extract common "interface up" code to a string
so that bridge service can use it
2023-08-28 22:02:28 +01:00
Daniel Barlow 04b59536d8 more thoughts 2023-08-28 22:02:28 +01:00
Daniel Barlow 540a1dfd76 remove interface.device
build-time uses can mostly be replaced with interface.name

for runtime uses, switch to $(output ${interface} name)
2023-08-28 22:02:28 +01:00
Daniel Barlow 6da0e67621 create outputs for network interface 2023-08-27 22:41:26 +01:00
Daniel Barlow 485ecc03b0 serviceDefn build function handles dependencies
in a bit of a hacky way, we culd clean this up
2023-08-27 22:40:54 +01:00
Daniel Barlow 6b28f5dd79 chrony: drop privileges 2023-08-27 22:40:49 +01:00
Daniel Barlow 81b56fb6a3 new type for interface (presently just alias to service) 2023-08-27 22:39:37 +01:00
Daniel Barlow 2ad203ce1f delete unused functoins in liminix-tools 2023-08-21 19:29:00 +01:00
Daniel Barlow f4ad4d3ce1 update bridge service doc 2023-08-18 23:58:06 +01:00
Daniel Barlow 5c8ee0578f check off some TODO items 2023-08-16 23:35:27 +01:00
Daniel Barlow 767b154eb2 fix pppoe test 2023-08-16 23:35:12 +01:00
Daniel Barlow 6f92f8fa8b merge bridge services into one 2023-08-16 23:29:53 +01:00
Daniel Barlow a019e59a80 improve doc 2023-08-16 22:52:16 +01:00
Daniel Barlow 625146d821 escape backslash in service type 2023-08-16 22:26:40 +01:00
Daniel Barlow 1b8536ff81 describe hostname option 2023-08-16 22:26:40 +01:00
Daniel Barlow bd908307c4 print module pathname if it contains services
so that the user knows what to add to their imports
2023-08-16 22:26:40 +01:00
Daniel Barlow d7785d9d75 if no preamble, print module pathname as headline
this was supposed to work already but was broken
2023-08-16 22:26:40 +01:00
Daniel Barlow f93c03c98a improve descriptions for base and busybox 2023-08-16 22:26:31 +01:00
Daniel Barlow 519de0b55c module docs: service modules are listed after plain modules 2023-08-12 20:10:40 +01:00
Daniel Barlow f20d1cfc01 print description only if present 2023-08-12 18:16:20 +01:00
Daniel Barlow e039783e67 exclude outputs from doc 2023-08-12 18:16:06 +01:00
Daniel Barlow dc4b7ebffd module docs: print examples 2023-08-11 21:12:57 +01:00
Daniel Barlow bd8d00fe13 TODO for modules phase 2023-08-11 18:28:30 +01:00
Daniel Barlow b81604870b extract kernel config options from base module
we then "import" them straight back into base.nix - it's not
as though you can opt out of having a kernel. But this means
they'll appear separately in the documentation
2023-08-11 18:15:17 +01:00
Daniel Barlow 3ea40f95dc convert pppoe to serviceDefn 2023-08-10 22:53:45 +01:00