From 22bc886f1ed031646a0a4dfb6502246d8aaa2b06 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sun, 24 Mar 2019 16:18:31 -0400 Subject: [PATCH] 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 ...`. --- ofborg/src/outpaths.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 ofborg/src/outpaths.nix diff --git a/ofborg/src/outpaths.nix b/ofborg/src/outpaths.nix old mode 100644 new mode 100755 index 995a8ff..483fcf2 --- a/ofborg/src/outpaths.nix +++ b/ofborg/src/outpaths.nix @@ -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 = [