genco::lang::nix

Function inherit

Source
pub fn inherit<M, N>(path: M, name: N) -> Import
where M: Into<ItemStr>, N: Into<ItemStr>,
Expand description
use genco::prelude::*;

let nixpkgs = nix::inherit("inputs", "nixpkgs");

let toks = quote! {
    $nixpkgs
};

assert_eq!(
    vec![
        "{",
        "    inputs,",
        "    ...",
        "}:",
        "",
        "let",
        "    inherit (inputs) nixpkgs;",
        "in",
        "",
        "nixpkgs",
    ],
    toks.to_file_vec()?
);