nim problems

This commit is contained in:
Daylin Morgan 2024-09-04 14:04:08 -05:00
parent c995d60900
commit 1fcd741bfa
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -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