PortValhalla/scripts/eval-module.sh

10 lines
300 B
Bash
Raw Normal View History

2024-06-20 16:25:57 +00:00
#!/bin/bash
2024-06-22 21:11:21 +00:00
function evalModule() {
2024-06-20 16:25:57 +00:00
local modulePath="$1";
local property="$2";
2024-06-23 10:19:59 +00:00
local nixPkgs='import <nixpkgs> { config = {}; overlays = []; }';
2024-06-20 16:25:57 +00:00
nix eval --file "$modulePath" "${@:3}" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property";
}
2024-06-22 21:11:21 +00:00
evalModule $@;