Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToAwkball ¶
func EncodeToAwkball(entrypoint string, modules []*NixOSModule) string
Encode encodes the NixOS modules in awkball format, with each file separated by a `#### path` marker. An awkball can be decoded to files using an awk one-liner.
#### configuration.nix content #### modules/a.nix content
The first module is considered the entrypoint and assigned the given entrypoint filename. Others are organized under modules. Imports are modified to match.
Types ¶
type NixOSModule ¶
type NixOSModule struct { Path string Content string Imports []*NixOSModuleImport }
NixOSModule represents info from a NixOS module.
func CollectModules ¶
func CollectModules(filesystem fs.FS, path string) ([]*NixOSModule, error)
CollectModules parses NixOS module import blocks recursively.
func ParseContent ¶
func ParseContent(content string) (*NixOSModule, error)
ParseContent parses NixOS Module imports.
func (*NixOSModule) RewriteImports ¶
func (m *NixOSModule) RewriteImports(prefix string) string
Rewrite imports returns the NixOS module content with imports rewritten for a remote system.
type NixOSModuleImport ¶
type NixOSModuleImport struct {
// contains filtered or unexported fields
}
type StringFile ¶
type StringFile struct {
// contains filtered or unexported fields
}
func NewStringFile ¶
func NewStringFile(content string) *StringFile
func (*StringFile) Close ¶
func (f *StringFile) Close() error
Close implements the fs.File interface
Click to show internal directories.
Click to hide internal directories.