outpaths.nix: Makes callable

The behaviour of the callable outpaths.nix is such that it will call
nix-env as expected to run the equivalent ofborg step, in the CWD.

The directory it is ran on can be changed using `--argstr path ...`.
This commit is contained in:
Samuel Dionne-Riel 2019-03-24 16:18:31 -04:00
parent 836b629629
commit 22bc886f1e

11
ofborg/src/outpaths.nix Normal file → Executable file
View file

@ -1,7 +1,12 @@
{ checkMeta }:
#!/usr/bin/env nix-shell
# When using as a callable script, passing `--argstr path some/path` overrides $PWD.
#!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true --argstr path $PWD -f"
{ checkMeta
, path ? ./.
}:
let
lib = import ./lib;
hydraJobs = import ./pkgs/top-level/release.nix
lib = import (path + "/lib");
hydraJobs = import (path + "/pkgs/top-level/release.nix")
# Compromise: accuracy vs. resources needed for evaluation.
{
supportedSystems = [