actually set the correct ttl

This commit is contained in:
Daylin Morgan 2024-07-08 07:55:08 -05:00
parent ec68314102
commit a04b4fd4c6
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -229,7 +229,7 @@ func Dry(verbose bool, minimal bool, rest ...string) {
cmd := exec.Command("nix", "build", "--dry-run") cmd := exec.Command("nix", "build", "--dry-run")
cmd.Args = append(cmd.Args, rest...) cmd.Args = append(cmd.Args, rest...)
if o.resetCache { if o.resetCache {
cmd.Args = append(cmd.Args, "--narinfo-cache-positive-ttl", "0") cmd.Args = append(cmd.Args, "--narinfo-cache-negative-ttl", "0")
} }
var spinnerMsg string var spinnerMsg string
if minimal { if minimal {
@ -285,7 +285,7 @@ func NixBuild(nom bool, minimal bool, rest ...string) {
} }
cmd := exec.Command(cmdName, "build") cmd := exec.Command(cmdName, "build")
if o.resetCache { if o.resetCache {
cmd.Args = append(cmd.Args, "--narinfo-cache-positive-ttl", "0") cmd.Args = append(cmd.Args, "--narinfo-cache-negative-ttl", "0")
} }
if minimal { if minimal {
log.Debug("populating args with derivations not already built") log.Debug("populating args with derivations not already built")
@ -388,6 +388,9 @@ func filter[T any](ss []T, test func(T) bool) (ret []T) {
func toBuildNixosConfiguration() []string { func toBuildNixosConfiguration() []string {
systemCmd := exec.Command("nix", "build", o.nixosConfigAttr(), "--dry-run") systemCmd := exec.Command("nix", "build", o.nixosConfigAttr(), "--dry-run")
if o.resetCache {
systemCmd.Args = append(systemCmd.Args, "--narinfo-cache-negative-ttl", "0")
}
result, err := cmdOutputWithSpinner( result, err := cmdOutputWithSpinner(
systemCmd, systemCmd,
fmt.Sprintf("running dry build for: %s", o.nixosConfigAttr()), fmt.Sprintf("running dry build for: %s", o.nixosConfigAttr()),