genco::lang::nix

Function with

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

let concat_map = nix::with("inputs.nixpkgs.lib", "concatMap");
let list_to_attrs = nix::with("inputs.nixpkgs.lib", "listToAttrs");

let toks = quote! {
    $list_to_attrs $concat_map
};

assert_eq!(
    vec![
        "{",
        "    inputs,",
        "    ...",
        "}:",
        "",
        "with inputs.nixpkgs.lib;",
        "",
        "listToAttrs concatMap",
    ],
    toks.to_file_vec()?
);