Add a script for evaluating modules
This commit is contained in:
parent
57eaa4df88
commit
1adba2b761
1 changed files with 9 additions and 0 deletions
9
scripts/eval-module.sh
Executable file
9
scripts/eval-module.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
function eval() {
|
||||
local modulePath="$1";
|
||||
local property="$2";
|
||||
local nixPkgs='import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05") { config = {}; overlays = []; }';
|
||||
nix eval --file "$modulePath" "${@:3}" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property";
|
||||
}
|
||||
|
||||
eval $@;
|
Loading…
Reference in a new issue