Skip to content

Commit f5821a8

Browse files
authored
[flakes] enable native nixpkgs download progress output (#623)
## Summary `nix flakes prefetch` has a native progress indicator in its output. However, it seems that using the `nixPackagesInstallWriter` would result in it not displaying. Perhaps because of the tab indentation? Not entirely sure. This PR uses the regular `io.writer` instead of the custom `nixPackagesInstallWriter` for the nixpkgs prefetch ## How was it tested? - set a new commit hash in devbox.json - ran `devbox shell` observed the progess indicator
1 parent 0892e0e commit f5821a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/impl/packages.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,18 @@ func (d *Devbox) addPackagesToProfile(mode installMode) error {
9696
"--extra-experimental-features", "nix-command flakes",
9797
nix.FlakeNixpkgs(d.cfg.Nixpkgs.Commit),
9898
)
99+
cmd.Stdout = d.writer
99100
} else {
100101
cmd = exec.Command(
101102
"nix", "profile", "install",
102103
"--profile", profileDir,
103104
"--extra-experimental-features", "nix-command flakes",
104105
nix.FlakeNixpkgs(d.cfg.Nixpkgs.Commit)+"#"+pkg,
105106
)
107+
cmd.Stdout = &nixPackageInstallWriter{d.writer}
106108
}
107109

108110
cmd.Env = nix.DefaultEnv()
109-
cmd.Stdout = &nixPackageInstallWriter{d.writer}
110111
cmd.Stderr = cmd.Stdout
111112
err = cmd.Run()
112113

0 commit comments

Comments
 (0)