File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 17
17
"nixpkgs" : {
18
18
"commit" : " 3954218cf613eba8e0dcefa9abe337d26bc48fd0"
19
19
}
20
- }
20
+ }
Original file line number Diff line number Diff line change @@ -607,7 +607,7 @@ func (d *Devbox) ensurePackagesAreInstalled(mode installMode) error {
607
607
}
608
608
609
609
// We need to re-install the packages
610
- if err := d .installNixProfile (); err != nil {
610
+ if err := d .installNixProfile (mode ); err != nil {
611
611
fmt .Fprintln (d .writer )
612
612
return errors .Wrap (err , "apply Nix derivation" )
613
613
}
@@ -667,7 +667,7 @@ func (d *Devbox) printPackageUpdateMessage(
667
667
668
668
// installNixProfile installs or uninstalls packages to or from this
669
669
// devbox's Nix profile so that it matches what's in development.nix or flake.nix
670
- func (d * Devbox ) installNixProfile () (err error ) {
670
+ func (d * Devbox ) installNixProfile (mode installMode ) (err error ) {
671
671
profileDir , err := d .profileDir ()
672
672
if err != nil {
673
673
return err
@@ -691,7 +691,10 @@ func (d *Devbox) installNixProfile() (err error) {
691
691
}
692
692
693
693
cmd .Env = nix .DefaultEnv ()
694
- cmd .Stdout = & nixPackageInstallWriter {d .writer }
694
+ cmd .Stdout = & nixPackageInstallWriter {
695
+ d .writer ,
696
+ lo .Ternary (mode != ensure , "\t " , "" ),
697
+ }
695
698
696
699
cmd .Stderr = cmd .Stdout
697
700
Original file line number Diff line number Diff line change @@ -11,14 +11,15 @@ var nixPackageInstallIgnore = []string{
11
11
}
12
12
13
13
type nixPackageInstallWriter struct {
14
- w io.Writer
14
+ w io.Writer
15
+ indent string
15
16
}
16
17
17
18
func (fw * nixPackageInstallWriter ) Write (p []byte ) (n int , err error ) {
18
19
lines := strings .Split (string (p ), "\n " )
19
20
for _ , line := range lines {
20
21
if line != "" && ! fw .ignore (line ) {
21
- _ , err = io .WriteString (fw .w , " \t " + line + "\n " )
22
+ _ , err = io .WriteString (fw .w , fw . indent + line + "\n " )
22
23
if err != nil {
23
24
return
24
25
}
You can’t perform that action at this time.
0 commit comments