PortValhalla/scripts/Common/Scripts/eval-module.fish

11 lines
367 B
Fish

#!/bin/env fish
function evalModule --argument-names modulePath property
set -l argv $argv[3..]
if not contains -- "--json" $argv
set -a argv --raw
end
set -l nixPkgs 'import <nixpkgs> { config = {}; overlay = []; }'
nix eval --file "$modulePath" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property" $argv
end