mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-27 16:33:05 +03:00
9b6638a1a7
* feat: return underlying d2n instance if pkgs was passed to init, document init pkgs * feat: implement makeOutputs * tests: dont fail if resolveImpure fails * feat: make init return a dream2nix instance, rework makeFlakeOutputs code * feat: default to source if config.projectRoot is not specified, update examples and readme * fix: update the simple template * docs: clarify init in readme * docs: change readme numbering to back to 1 * refactor: dont default projectRoot to source * docs: make extensive example use makeFlakeOutputs, link per-pkgs d2n example in readme * fix: call loadConfig correctly
50 lines
819 B
Nix
50 lines
819 B
Nix
{
|
|
self,
|
|
lib,
|
|
async,
|
|
bash,
|
|
coreutils,
|
|
git,
|
|
parallel,
|
|
nix,
|
|
utils,
|
|
dream2nixWithExternals,
|
|
...
|
|
}: let
|
|
l = lib // builtins;
|
|
examples = ../../examples;
|
|
testScript =
|
|
utils.writePureShellScript
|
|
[
|
|
async
|
|
bash
|
|
coreutils
|
|
git
|
|
nix
|
|
]
|
|
''
|
|
dir=$1
|
|
shift
|
|
echo -e "\ntesting example for $dir"
|
|
cp -r ${examples}/$dir/* .
|
|
chmod -R +w .
|
|
nix flake lock --override-input dream2nix ${../../.}
|
|
nix run .#resolveImpure || echo "no resolveImpure probably?"
|
|
nix flake check "$@"
|
|
'';
|
|
in
|
|
utils.writePureShellScript
|
|
[
|
|
coreutils
|
|
parallel
|
|
]
|
|
''
|
|
if [ -z ''${1+x} ]; then
|
|
parallel -j$(nproc) -a <(ls ${examples}) ${testScript}
|
|
else
|
|
arg1=$1
|
|
shift
|
|
${testScript} $arg1 "$@"
|
|
fi
|
|
''
|