mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-23 03:45:50 -06:00
nix-eval-jobs only taks one argument
This commit is contained in:
parent
9f178c0de0
commit
315a741882
1 changed files with 15 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
||||||
import std/[
|
import std/[
|
||||||
algorithm, json, enumerate,
|
algorithm, json, enumerate,
|
||||||
os, sequtils, strformat, strutils,
|
os, sequtils, strformat, strutils,
|
||||||
sugar, logging, tables, times
|
sugar, logging, tables, times, sets
|
||||||
]
|
]
|
||||||
export tables
|
export tables
|
||||||
import hwylterm, hwylterm/logging, jsony
|
import hwylterm, hwylterm/logging, jsony
|
||||||
|
@ -226,14 +226,16 @@ proc getSystemPathInputDrvs*(): seq[string] =
|
||||||
|
|
||||||
proc missingDrvNixEvalJobs*(): seq[NixEvalOutput] =
|
proc missingDrvNixEvalJobs*(): seq[NixEvalOutput] =
|
||||||
## get all derivations not cached using nix-eval-jobs
|
## get all derivations not cached using nix-eval-jobs
|
||||||
var cmd = ("nix-eval-jobs")
|
var cmd = "nix-eval-jobs"
|
||||||
cmd.addArgs "--flake", "--check-cache-status"
|
cmd.addArgs "--flake", "--check-cache-status"
|
||||||
cmd.addArgs getHosts().mapIt(".#systemPaths." & it)
|
var output: string
|
||||||
|
|
||||||
let (output, _) = runCmdCaptWithSpinner(
|
for host in getHosts():
|
||||||
cmd,
|
let (o, _) = runCmdCaptWithSpinner(
|
||||||
bb"running [b]nix-eval-jobs[/] for system paths: " & (getHosts().join(" ").bb("bold")),
|
cmd & (getFlake() & "#systemPaths." & host),
|
||||||
)
|
bb"running [b]nix-eval-jobs[/] for system path: " & host.bb("bold")
|
||||||
|
)
|
||||||
|
output.add o
|
||||||
|
|
||||||
var cached: seq[NixEvalOutput]
|
var cached: seq[NixEvalOutput]
|
||||||
var ignored: seq[NixEvalOutput]
|
var ignored: seq[NixEvalOutput]
|
||||||
|
@ -245,11 +247,13 @@ proc missingDrvNixEvalJobs*(): seq[NixEvalOutput] =
|
||||||
elif output.name.isIgnored():
|
elif output.name.isIgnored():
|
||||||
ignored.add output
|
ignored.add output
|
||||||
else:
|
else:
|
||||||
result.add output
|
result.add output
|
||||||
|
|
||||||
debug "cached derivations: ", bb($cached.len, "yellow")
|
debug "cached derivations: ", bb($cached.len, "yellow")
|
||||||
debug "ignored derivations: ", bb($ignored.len, "yellow")
|
debug "ignored derivations: ", bb($ignored.len, "yellow")
|
||||||
|
|
||||||
|
result = result.toSet().toSeq()
|
||||||
|
|
||||||
func fmtDrvsForNix*(drvs: seq[NixEvalOutput]): string {.inline.} =
|
func fmtDrvsForNix*(drvs: seq[NixEvalOutput]): string {.inline.} =
|
||||||
drvs.mapIt(it.drvPath & "^*").join(" ")
|
drvs.mapIt(it.drvPath & "^*").join(" ")
|
||||||
|
|
||||||
|
@ -385,9 +389,9 @@ proc build(drv: NixEvalOutput, rest: seq[string]): BuildResult =
|
||||||
|
|
||||||
info "-> duration: " & formatDuration(result.duration)
|
info "-> duration: " & formatDuration(result.duration)
|
||||||
|
|
||||||
func outputsPaths(drv: NixDerivation): seq[string] =
|
# func outputsPaths(drv: NixDerivation): seq[string] =
|
||||||
for _, output in drv.outputs:
|
# for _, output in drv.outputs:
|
||||||
result.add output.path
|
# result.add output.path
|
||||||
|
|
||||||
proc reportResults(results: seq[(NixEvalOutput, BuildResult)]) =
|
proc reportResults(results: seq[(NixEvalOutput, BuildResult)]) =
|
||||||
let rows = collect(
|
let rows = collect(
|
||||||
|
@ -412,7 +416,6 @@ proc prettyDerivation*(path: string): BbString =
|
||||||
let drv = path.toDerivation()
|
let drv = path.toDerivation()
|
||||||
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
|
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
|
||||||
|
|
||||||
|
|
||||||
proc nixBuildWithCache*(name: string, rest: seq[string], service: string, jobs: int, dry: bool) =
|
proc nixBuildWithCache*(name: string, rest: seq[string], service: string, jobs: int, dry: bool) =
|
||||||
## build individual derivations not cached and push to cache
|
## build individual derivations not cached and push to cache
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue