sigil/nixos-modules/services/tor.dhall

55 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-04-21 09:59:27 +02:00
let Sigil =
env:DHALL_SIGIL
? https://git.sr.ht/~ehmry/dhall-sigil/blob/trunk/package.dhall
2021-04-10 17:11:43 +02:00
let Init = Sigil.Init
let Libc = Sigil.Libc
let VFS = Sigil.VFS
in λ(args : List Text) →
2021-04-12 21:08:24 +02:00
λ(vfs : { lwip : Text, pipe : Text }) →
2021-04-10 17:11:43 +02:00
λ(binary : Text) →
Init.Child.flat
Init.Child.Attributes::{
, binary
, config =
Libc.toConfig
Libc::{
, args
, pipe = Some "/dev/pipes"
2021-04-12 21:08:24 +02:00
, rng = Some "/dev/entropy"
2021-04-10 17:11:43 +02:00
, socket = Some "/dev/sockets"
, vfs =
[ VFS.dir
"dev"
[ VFS.leaf "null"
, VFS.leaf "log"
, VFS.leaf "rtc"
2021-04-12 21:08:24 +02:00
, VFS.leafAttrs
"terminal"
(toMap { name = "entropy", label = "entropy" })
, VFS.dir
"pipes"
[ VFS.leafAttrs "plugin" (toMap { load = vfs.pipe }) ]
2021-04-10 17:11:43 +02:00
, VFS.dir
"sockets"
2021-04-12 21:08:24 +02:00
[ VFS.leafAttrs
"plugin"
(toMap { load = vfs.lwip, label = "uplink" })
]
2021-04-10 17:11:43 +02:00
]
, VFS.dir
"nix"
[ VFS.dir
"store"
[ VFS.fs
VFS.FS::{ label = "nix-store", writeable = "no" }
]
]
]
}
2021-04-12 21:08:24 +02:00
, resources = Init.Resources::{ caps = 512, ram = Sigil.units.MiB 384 }
2021-04-10 17:11:43 +02:00
}