diff --git a/pkgs/oizys/src/oizys/nix.nim b/pkgs/oizys/src/oizys/nix.nim index 10f5380..5723581 100644 --- a/pkgs/oizys/src/oizys/nix.nim +++ b/pkgs/oizys/src/oizys/nix.nim @@ -367,6 +367,12 @@ proc reportResults(results: seq[(OizysDerivation, BuildResult)]) = output.writeLine rows.join("\n") close output +proc prettyDerivation*(path: string): BbString = + const maxLen = 40 + let drv = path.toDerivation() + drv.name.trunc(maxLen) & " " & drv.hash.bb("faint") + + proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int) = ## build individual derivations not cached and push to cache if findExe(service) == "": fatalQuit fmt"is {service} installed?" @@ -377,6 +383,8 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i info "nothing to build" quit "exiting...", QuitSuccess + info fmt("building {drvs.len} derivations:\n") & drvs.mapIt(prettyDerivation(it.drv.outputs["out"].path)).join("\n") + let results = collect: for drv in drvs: diff --git a/pkgs/oizys/src/oizys/utils.nim b/pkgs/oizys/src/oizys/utils.nim index 3637f54..a345db3 100644 --- a/pkgs/oizys/src/oizys/utils.nim +++ b/pkgs/oizys/src/oizys/utils.nim @@ -56,11 +56,6 @@ proc hasNarinfo*(cache: string, path: string): Opt[string] = finally: client.close() -proc prettyDerivation(path: string): BbString = - const maxLen = 40 - let drv = path.toDerivation() - drv.name.trunc(maxLen) & " " & drv.hash.bb("faint") - proc showNarInfo(s: string): BbString = let maxWidth = terminalWidth() result.add "narinfo:"