1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! # tatara-os — our NixOS, expressed in Rust + tatara-lisp
//!
//! A full Linux operating system authored as a single `(defsystem …)` form.
//! Runs on the Linux kernel; reuses nixpkgs for userspace today (via
//! `tatara-pkgs::NixpkgsBridge`); transliterates to pure tatara-lisp over
//! time.
//!
//! ## Type surface
//!
//! ```text
//! SystemConfig
//! ├── hostname, system
//! ├── kernel : KernelSpec (bridged by default → linuxPackages.kernel)
//! ├── bootloader : BootloaderSpec (Grub | SystemdBoot | Uboot | None)
//! ├── init : InitSystem (Systemd | S6 | OpenRC)
//! ├── services : Vec<ServiceSpec>
//! ├── users : Vec<UserSpec>
//! ├── filesystems : Vec<FilesystemSpec>
//! └── environment : EnvSpec (etc files, path, locale, timezone)
//! ```
//!
//! ## Synthesis
//!
//! `SystemSynthesizer` (impl of `tatara_nix::Synthesizer`) takes a
//! `SystemConfig`, walks it, and produces a `SystemClosure`:
//!
//! 1. The kernel derivation
//! 2. An `/etc` derivation (hostname file, os-release, passwd, group)
//! 3. A systemd-unit derivation per service
//! 4. A bootloader-config derivation
//! 5. An **activation script** — the shell script `switch-to-configuration`
//! calls to move the running system to the configured state.
//! 6. A top-level **profile** derivation that composes all of the above into
//! one content-addressed root.
//!
//! ## Lisp authoring
//!
//! ```lisp
//! (defsystem my-host
//! :hostname "plex"
//! :system "x86_64-linux"
//! :kernel (:bridge "linuxPackages.kernel")
//! :bootloader (:kind SystemdBoot :device "/boot")
//! :init Systemd
//! :services ((:name "nginx" :exec "nginx -g 'daemon off;'" :enable #t)
//! (:name "fumi" :exec "/run/current-system/sw/bin/fumi" :enable #t))
//! :users ((:name "drzzln" :uid 1000 :home "/home/drzzln" :shell "/run/current-system/sw/bin/zsh"))
//! :filesystems (((:mount "/" :device "/dev/sda2" :fs-type "ext4"))
//! ((:mount "/boot" :device "/dev/sda1" :fs-type "vfat")))
//! :environment (:timezone "America/Sao_Paulo" :locale "en_US.UTF-8"))
//! ```
pub use ActivationScript;
pub use ;
pub use ;
pub use SystemSynthesizer;