Allow applying custom functions during evaluation

This commit is contained in:
Manuel Thalmann 2024-07-20 00:36:19 +02:00
parent 2848e5b52c
commit 5fa9f49b58
2 changed files with 23 additions and 2 deletions
scripts/Common/Scripts

View file

@ -6,6 +6,11 @@ function evalModule --argument-names modulePath property
set -a argv --raw
end
set -l nixPkgs 'import <nixpkgs> { config = {}; overlay = []; }'
nix eval --file "$modulePath" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property" $argv
FILE=(realpath "$modulePath") \
PROPERTY="$property" \
nix eval \
--file "$(status dirname)/../../../lib/eval-module.nix" \
$argv
end
evalModule $argv