code wiki / (root) / nx_media_env.nx

nx_media_env.nx

buildroot/runtime/nx_media_env.nx

6385 B109 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic media
docsdependenciesstructsconstsfunctions

about

nx_media_env.nx -- SOVEREIGN, PORTABLE launch config for the media/torrent daemon. The per-spoke storage layout is DATA-DRIVEN (CLAUDE.md #11/#17): it lives in a profile TABLE here, NOT hardcoded in the daemon and NOT in a .tsv. Porting the daemon to a new spoke (the NAS hub, another box) = ADD A PROFILE ROW -- nothing in the daemon changes. The profile is chosen by name (argv[1], default "dev"); this launcher ensures the area dirs exist, DEPLOYS the bundle's worker elfs into /tmp (the daemon's launch contract: it execs /tmp/nx_*.sov.elf), then execs the daemon with the profile's roots. The SAME bundle therefore runs on the dev laptop and the NAS hub by configuration alone. Used by: the NAS nx_hostctl spawn cmd -> `nx_media_env hub`; the dev box can use `nx_media_env dev`. license_tier: ORIGINAL layer: L7 (portable launch config over the L6 daemon) module: nishi-core.media.env depends: nishi-core.syscalls

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_media_env.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main me_puts sys_write me_streq me_launch sys_mkdir me_puts ↻ me_join sys_mmap sys_execve sys_exit sys_exit ↻

structs

none

consts

15const K_MAGIC_262144: i64 = 262144
16const K_MAGIC_1024: i64 = 1024
17const K_MAGIC_8097: i64 = 8097

functions

19func me_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 }
20func me_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: me_launchmain calls 1: sys_write
23func me_join(dir: *u8, name: *u8, out: *u8) -> *u8
33func me_copy(src: *u8, dst: *u8) -> i64
44func me_deploy_bundle(bundle_dir: *u8) -> i64
68func me_launch(sfw: *u8, nsfw: *u8, index: *u8, bundle: *u8, bind_mode: *u8) -> i64
83func main(argc: i64, argv: *i64) -> i64