cmd/nix-tool: pass --store via extraArgs
Sleepy me forgot about passing extraArgs :c
This commit is contained in:
parent
d6d327cb91
commit
55933ccfb3
@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
|
||||
"gensokyo.uk/nix"
|
||||
)
|
||||
|
||||
type chrootStoreContext struct {
|
||||
store string
|
||||
nix.Context
|
||||
}
|
||||
|
||||
func (c *chrootStoreContext) Nix(ctx context.Context, arg ...string) *exec.Cmd {
|
||||
return c.Context.Nix(ctx, append([]string{"--store", c.store}, arg...)...)
|
||||
}
|
@ -36,16 +36,17 @@ func main() {
|
||||
c := command.New(os.Stderr, log.Printf, "nix-tool", func(args []string) error {
|
||||
log.SetFlags(0)
|
||||
|
||||
var extraArgs []string
|
||||
flagStore = strings.TrimSpace(flagStore)
|
||||
if flagStore != string(os.PathSeparator) {
|
||||
extraArgs = append(extraArgs, "--store", flagStore)
|
||||
}
|
||||
|
||||
var stderr io.Writer
|
||||
if flagVerbose {
|
||||
stderr = os.Stderr
|
||||
}
|
||||
ctx = nix.New(nixCtx, nil, os.Stdout, stderr)
|
||||
|
||||
flagStore = strings.TrimSpace(flagStore)
|
||||
if flagStore != string(os.PathSeparator) {
|
||||
ctx = &chrootStoreContext{flagStore, ctx}
|
||||
}
|
||||
ctx = nix.New(nixCtx, extraArgs, os.Stdout, stderr)
|
||||
|
||||
return nil
|
||||
}).
|
||||
|
Loading…
x
Reference in New Issue
Block a user