mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 10:10:45 -06:00
nim problems
This commit is contained in:
parent
c995d60900
commit
1fcd741bfa
1 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
import std/[
|
import std/[
|
||||||
algorithm, json,
|
algorithm, json,
|
||||||
enumerate, os, osproc, sequtils, strformat,
|
enumerate, os, sequtils, strformat,
|
||||||
strutils, sugar, logging, tables
|
strutils, sugar, logging, tables
|
||||||
]
|
]
|
||||||
import bbansi, jsony
|
import bbansi, jsony
|
||||||
|
@ -110,8 +110,11 @@ proc toBuildNixosConfiguration(): seq[string] =
|
||||||
var cmd = nixCommand("build")
|
var cmd = nixCommand("build")
|
||||||
cmd.addArg "--dry-run"
|
cmd.addArg "--dry-run"
|
||||||
cmd.addArgs nixosConfigAttrs()
|
cmd.addArgs nixosConfigAttrs()
|
||||||
# let (_, err) = runCmdCaptWithSpinner(cmd, "running dry run build for: " & getHosts().join(" "))
|
let (_, err) = runCmdCaptWithSpinner(
|
||||||
let (_, err, _) = runCmdCapt(cmd, {CaptStderr})
|
cmd,
|
||||||
|
"running dry run build for: " & getHosts().join(" "),
|
||||||
|
capture ={CaptStderr}
|
||||||
|
)
|
||||||
let output = parseDryRunOutput err
|
let output = parseDryRunOutput err
|
||||||
return output.toBuild.mapIt(it.storePath)
|
return output.toBuild.mapIt(it.storePath)
|
||||||
|
|
||||||
|
@ -120,12 +123,12 @@ type
|
||||||
inputDrvs: Table[string, JsonNode]
|
inputDrvs: Table[string, JsonNode]
|
||||||
name: string
|
name: string
|
||||||
|
|
||||||
proc evaluateDerivations(drvs: seq[string]): Table[string,NixDerivation] =
|
proc evaluateDerivations(drvs: seq[string]): Table[string, NixDerivation] =
|
||||||
var cmd = "nix derivation show -r"
|
var cmd = "nix derivation show -r"
|
||||||
cmd.addArgs drvs
|
cmd.addArgs drvs
|
||||||
let (output, _) =
|
let (output, _) =
|
||||||
runCmdCaptWithSpinner(cmd, "evaluating derivations")
|
runCmdCaptWithSpinner(cmd, "evaluating derivations")
|
||||||
output.fromJson(Table[string,NixDerivation])
|
fromJson(output, Table[string,NixDerivation])
|
||||||
|
|
||||||
|
|
||||||
# TODO: replace asserts in this proc
|
# TODO: replace asserts in this proc
|
||||||
|
|
Loading…
Reference in a new issue