pub struct ModuleNode {
pub id: ModuleId,
pub label: String,
pub ast_graph_hash: [u8; 32],
pub option_decls: Vec<OptionDecl>,
pub setters: Vec<ConfigSetter>,
pub imports: Vec<ImportEdge>,
pub body_env_prefix: Vec<EnvPrefixBinding>,
}Expand description
One module: the typed projection of one .nix (or future .tlisp)
file’s contribution to the system.
Fields§
§id: ModuleId§label: StringHuman-readable label (the file path relative to the flake root,
e.g. "profiles/nixos-attic-cache-warmer/default.nix").
ast_graph_hash: [u8; 32]Hash of the AstGraph this module was lowered from. Two modules with byte-identical AST contribute identically; the compiler can memoize on this.
option_decls: Vec<OptionDecl>Option declarations this module contributes to the schema.
setters: Vec<ConfigSetter>Config-setter fragments. One per logical assignment in the
module’s body. mkMerge / mkIf are pre-split here.
imports: Vec<ImportEdge>Import edges: which other modules this one pulls into the system. Resolved at parse time so the runtime view is flat.
body_env_prefix: Vec<EnvPrefixBinding>Env-prefix bindings captured from the module’s outer wrappers
(let-in bindings, with-scope attrsets). Each entry maps an
identifier name to the AST node id whose evaluation produces
the binding’s value. The evaluator seeds each setter’s
evaluation env with these BEFORE adding config — so a setter
body that references cfg (bound by an outer let cfg = config.foo;) resolves correctly.
Two entry kinds today:
- Named bindings from outer
let ... in BODYclauses. - Synthetic
__with_<n>entries for each outerwith X;scope, where X’s evaluation result is unpacked into the env (its attrset attrs become top-level idents).__with_<n>itself is never directly referenced; it’s a placeholder so the evaluator knows to unpack the value.
Trait Implementations§
Source§impl Archive for ModuleNodewhere
ModuleId: Archive,
String: Archive,
[u8; 32]: Archive,
Vec<OptionDecl>: Archive,
Vec<ConfigSetter>: Archive,
Vec<ImportEdge>: Archive,
Vec<EnvPrefixBinding>: Archive,
impl Archive for ModuleNodewhere
ModuleId: Archive,
String: Archive,
[u8; 32]: Archive,
Vec<OptionDecl>: Archive,
Vec<ConfigSetter>: Archive,
Vec<ImportEdge>: Archive,
Vec<EnvPrefixBinding>: Archive,
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedModuleNode
type Archived = ArchivedModuleNode
Source§type Resolver = ModuleNodeResolver
type Resolver = ModuleNodeResolver
Source§impl Clone for ModuleNode
impl Clone for ModuleNode
Source§fn clone(&self) -> ModuleNode
fn clone(&self) -> ModuleNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModuleNode
impl Debug for ModuleNode
Source§impl<'de> Deserialize<'de> for ModuleNode
impl<'de> Deserialize<'de> for ModuleNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<__D: Fallible + ?Sized> Deserialize<ModuleNode, __D> for Archived<ModuleNode>where
ModuleId: Archive,
<ModuleId as Archive>::Archived: Deserialize<ModuleId, __D>,
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
[u8; 32]: Archive,
<[u8; 32] as Archive>::Archived: Deserialize<[u8; 32], __D>,
Vec<OptionDecl>: Archive,
<Vec<OptionDecl> as Archive>::Archived: Deserialize<Vec<OptionDecl>, __D>,
Vec<ConfigSetter>: Archive,
<Vec<ConfigSetter> as Archive>::Archived: Deserialize<Vec<ConfigSetter>, __D>,
Vec<ImportEdge>: Archive,
<Vec<ImportEdge> as Archive>::Archived: Deserialize<Vec<ImportEdge>, __D>,
Vec<EnvPrefixBinding>: Archive,
<Vec<EnvPrefixBinding> as Archive>::Archived: Deserialize<Vec<EnvPrefixBinding>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<ModuleNode, __D> for Archived<ModuleNode>where
ModuleId: Archive,
<ModuleId as Archive>::Archived: Deserialize<ModuleId, __D>,
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
[u8; 32]: Archive,
<[u8; 32] as Archive>::Archived: Deserialize<[u8; 32], __D>,
Vec<OptionDecl>: Archive,
<Vec<OptionDecl> as Archive>::Archived: Deserialize<Vec<OptionDecl>, __D>,
Vec<ConfigSetter>: Archive,
<Vec<ConfigSetter> as Archive>::Archived: Deserialize<Vec<ConfigSetter>, __D>,
Vec<ImportEdge>: Archive,
<Vec<ImportEdge> as Archive>::Archived: Deserialize<Vec<ImportEdge>, __D>,
Vec<EnvPrefixBinding>: Archive,
<Vec<EnvPrefixBinding> as Archive>::Archived: Deserialize<Vec<EnvPrefixBinding>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ModuleNode, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ModuleNode, <__D as Fallible>::Error>
Source§impl PartialEq for ModuleNode
impl PartialEq for ModuleNode
Source§impl Serialize for ModuleNode
impl Serialize for ModuleNode
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for ModuleNodewhere
ModuleId: Serialize<__S>,
String: Serialize<__S>,
[u8; 32]: Serialize<__S>,
Vec<OptionDecl>: Serialize<__S>,
Vec<ConfigSetter>: Serialize<__S>,
Vec<ImportEdge>: Serialize<__S>,
Vec<EnvPrefixBinding>: Serialize<__S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for ModuleNodewhere
ModuleId: Serialize<__S>,
String: Serialize<__S>,
[u8; 32]: Serialize<__S>,
Vec<OptionDecl>: Serialize<__S>,
Vec<ConfigSetter>: Serialize<__S>,
Vec<ImportEdge>: Serialize<__S>,
Vec<EnvPrefixBinding>: Serialize<__S>,
impl StructuralPartialEq for ModuleNode
Source§impl TataraDomain for ModuleNode
impl TataraDomain for ModuleNode
Source§fn compile_from_args(args: &[Sexp]) -> Result<Self>
fn compile_from_args(args: &[Sexp]) -> Result<Self>
Auto Trait Implementations§
impl Freeze for ModuleNode
impl RefUnwindSafe for ModuleNode
impl Send for ModuleNode
impl Sync for ModuleNode
impl Unpin for ModuleNode
impl UnsafeUnpin for ModuleNode
impl UnwindSafe for ModuleNode
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.