mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-01-22 07:07:32 -06:00
add flag to switch to using nom
This commit is contained in:
parent
cba22cbd48
commit
f977e745d8
2 changed files with 15 additions and 7 deletions
|
@ -41,8 +41,10 @@ hwylCli:
|
||||||
... "nix build"
|
... "nix build"
|
||||||
flags:
|
flags:
|
||||||
^minimal
|
^minimal
|
||||||
|
nom:
|
||||||
|
? "use nom"
|
||||||
run:
|
run:
|
||||||
nixBuild(minimal, args)
|
nixBuild(minimal, nom, args)
|
||||||
|
|
||||||
[cache]
|
[cache]
|
||||||
... "build and push store paths"
|
... "build and push store paths"
|
||||||
|
|
|
@ -7,12 +7,18 @@ import hwylterm, hwylterm/logging, jsony
|
||||||
|
|
||||||
import ./[context, exec]
|
import ./[context, exec]
|
||||||
|
|
||||||
proc nixCommand(cmd: string): string =
|
proc nixCommand(cmd: string, nom: bool = false): string =
|
||||||
|
if nom:
|
||||||
|
if findExe("nom") == "":
|
||||||
|
fatalQuit "--nom requires nix-output-monitor is installed"
|
||||||
|
result = "nom"
|
||||||
|
else:
|
||||||
result = "nix"
|
result = "nix"
|
||||||
|
result.addArg cmd
|
||||||
if isResetCache():
|
if isResetCache():
|
||||||
result.addArg "--narinfo-cache-negative-ttl 0"
|
result.addArg "--narinfo-cache-negative-ttl 0"
|
||||||
|
if not nom:
|
||||||
result.addArg "--log-format multiline"
|
result.addArg "--log-format multiline"
|
||||||
result.addArg cmd
|
|
||||||
|
|
||||||
proc nixosConfigAttr(host: string): string =
|
proc nixosConfigAttr(host: string): string =
|
||||||
getFlake() & "#nixosConfigurations." & host & ".config.system.build.toplevel"
|
getFlake() & "#nixosConfigurations." & host & ".config.system.build.toplevel"
|
||||||
|
@ -250,8 +256,8 @@ proc writeDervationsToStepSummary(drvs: seq[string]) =
|
||||||
output.writeLine(rows.join("\n"))
|
output.writeLine(rows.join("\n"))
|
||||||
close output
|
close output
|
||||||
|
|
||||||
proc nixBuild*(minimal: bool, rest: seq[string]) =
|
proc nixBuild*(minimal: bool, nom: bool, rest: seq[string]) =
|
||||||
var cmd = nixCommand("build")
|
var cmd = nixCommand("build", nom)
|
||||||
if minimal:
|
if minimal:
|
||||||
debug "populating args with derivations not built/cached"
|
debug "populating args with derivations not built/cached"
|
||||||
let drvs = systemPathDrvsToBuild()
|
let drvs = systemPathDrvsToBuild()
|
||||||
|
|
Loading…
Reference in a new issue