warbo-utilities: c07b845bdbd184a30747c63df5434e23e7907681

     1: { bash, wrap, writeScript }:
     2: 
     3: wrap {
     4:   name = "nix_build";
     5:   paths = [ bash ];
     6:   vars = {
     7:     expr = writeScript "nix_build_expr.nix" ''
     8:       with builtins;
     9:       with import <nixpkgs> {};
    10:       with rec {
    11:         src = getEnv "JOB";
    12:         job = if typeOf (import src) == "lambda"
    13:                  then callPackage src {}
    14:                  else import src;
    15:       };
    16:       withDeps (allDrvsIn job) nothing
    17:     '';
    18:   };
    19:   script = ''
    20:     #!${bash}/bin/bash
    21:     JOB="$PWD/release.nix"
    22:     [[ -z "$1" ]] || JOB=$(readlink -f "$1")
    23:     export JOB
    24: 
    25:     [[ -e "$JOB" ]] || fail "Couldn't find '$JOB'; maybe give an argument?"
    26: 
    27:     echo "Building derivations from '$JOB'" 1>&2
    28:     nix-build --show-trace --no-out-link -E 'import (builtins.getEnv "expr")'
    29:   '';
    30: }

Generated by git2html.