pub struct LinuxRootfs {
pub init_binary: String,
pub init_config: String,
pub extra_files: Vec<InitrdFile>,
pub busybox: Option<String>,
pub sshd: Option<SshdSpec>,
pub packages: Vec<GuestPackage>,
pub name: String,
}Expand description
The full recipe for a bootable initrd.
Fields§
§init_binary: String§init_config: String§extra_files: Vec<InitrdFile>§busybox: Option<String>Bridge the busybox binary into the guest. Default: busybox from nixpkgs.
sshd: Option<SshdSpec>Optional sshd setup. When Some, the emitted runCommand pulls the
full pkgs.openssh closure into root/nix/store/, symlinks
/bin/sshd + /bin/ssh-keygen, generates a host key at build time,
and writes /etc/ssh/{sshd_config, authorized_keys}. The caller is
responsible for adding the sshd service to init_config.
packages: Vec<GuestPackage>Userspace packages to install in the guest. Each package’s closure
is copied into root/nix/store/; bin entries land in /bin/.
name: StringName baked into the output derivation.
Implementations§
Source§impl LinuxRootfs
impl LinuxRootfs
pub fn new( init_binary: impl Into<String>, init_config: impl Into<String>, ) -> Self
pub fn with_name(self, n: impl Into<String>) -> Self
pub fn with_file( self, path: impl Into<String>, content: impl Into<String>, ) -> Self
pub fn with_file_from_store( self, path: impl Into<String>, store_path: impl Into<String>, ) -> Self
pub fn without_busybox(self) -> Self
Sourcepub fn with_sshd(self, spec: SshdSpec) -> Self
pub fn with_sshd(self, spec: SshdSpec) -> Self
Bake openssh + sshd_config + authorized_keys + a generated ed25519 host key into the initrd.
Sourcepub fn with_package(self, attr_path: impl Into<String>) -> Self
pub fn with_package(self, attr_path: impl Into<String>) -> Self
Add one userspace package. bin_names empty means “symlink every
bin/* entry into /bin/”.
Sourcepub fn with_packages<I, S>(self, attrs: I) -> Self
pub fn with_packages<I, S>(self, attrs: I) -> Self
Add many packages at once.
Sourcepub fn derivation(&self) -> Derivation
pub fn derivation(&self) -> Derivation
Produce the tatara Derivation whose realization is the initrd.cpio.gz.
Sourcepub fn to_nix_expr(&self) -> String
pub fn to_nix_expr(&self) -> String
Emit the full runCommand Nix expression.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinuxRootfs
impl RefUnwindSafe for LinuxRootfs
impl Send for LinuxRootfs
impl Sync for LinuxRootfs
impl Unpin for LinuxRootfs
impl UnsafeUnpin for LinuxRootfs
impl UnwindSafe for LinuxRootfs
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more