sigil/nixos-modules/services/tor.dhall

46 lines
1.3 KiB
Plaintext

let Sigil = env:DHALL_SIGIL
let Init = Sigil.Init
let Libc = Sigil.Libc
let VFS = Sigil.VFS
in λ(args : List Text) →
λ(lwipCap : Text) →
λ(binary : Text) →
Init.Child.flat
Init.Child.Attributes::{
, binary
, config =
Libc.toConfig
Libc::{
, args
, pipe = Some "/dev/pipes"
, rtc = Some "/dev/random"
, socket = Some "/dev/sockets"
, vfs =
[ VFS.dir
"dev"
[ VFS.leaf "null"
, VFS.leaf "log"
, VFS.leaf "rtc"
, VFS.leafAttrs "terminal" (toMap { label = "entropy" })
, VFS.dir "pipes" [ VFS.leaf "pipe" ]
, VFS.dir
"sockets"
[ VFS.leafAttrs "plugin" (toMap { load = lwipCap }) ]
]
, VFS.dir
"nix"
[ VFS.dir
"store"
[ VFS.fs
VFS.FS::{ label = "nix-store", writeable = "no" }
]
]
]
}
, resources = Init.Resources::{ caps = 256, ram = Sigil.units.MiB 64 }
}