PortValhalla/scripts/eval-module.sh

9 lines
300 B
Bash
Executable file

#!/bin/bash
function evalModule() {
local modulePath="$1";
local property="$2";
local nixPkgs='import <nixpkgs> { config = {}; overlays = []; }';
nix eval --file "$modulePath" "${@:3}" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property";
}
evalModule $@;