Skip to main content

NixpkgsBridge

Struct NixpkgsBridge 

Source
pub struct NixpkgsBridge {
    pub pkg_set: Option<String>,
    pub known_names: Vec<String>,
    pub label: String,
}
Expand description

Bridges a list of names through to an existing Nix expression universe. By default that’s import <nixpkgs> {}, but any expression that yields an attribute set will do (flake revisions, release.nix, a private overlay).

Fields§

§pkg_set: Option<String>

Nix expression evaluating to the attribute root. Default: "import <nixpkgs> {}".

§known_names: Vec<String>

Names this bridge claims to know. Empty list = “open universe” — any name resolves. Non-empty list = closed universe (used for mirror gen).

§label: String

Human label for logs.

Implementations§

Source§

impl NixpkgsBridge

Source

pub fn new() -> Self

Source

pub fn with_pkg_set(self, expr: impl Into<String>) -> Self

Source

pub fn with_names(self, names: Vec<String>) -> Self

Source

pub fn with_label(self, label: impl Into<String>) -> Self

Source

pub fn derivation(&self, attr_path: impl Into<String>) -> Derivation

Build a Derivation for a name without consulting known_names. Useful when you’re sure the attr exists upstream.

Trait Implementations§

Source§

impl Default for NixpkgsBridge

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PackageSet for NixpkgsBridge

Source§

fn get(&self, name: &str) -> Result<PackageLookup, PackageSetError>

Retrieve the derivation for a named package. None if not present.
Source§

fn names(&self) -> Vec<String>

Short list of package names this set knows about. May be a finite enumeration (LispPackageSet) or a caller-provided seed (NixpkgsBridge doesn’t enumerate nixpkgs by default — too large).
Source§

fn label(&self) -> &str

Optional provenance label for logging / error messages.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.